I'm trying to migrate from FQL to Graph api and I'm running into some issues while trying to fetch unpublished posts from a page as they're not showing up.
This is the FQL:
select description,actor_id,app_data,app_id,attachment,comment_info, created_time,feed_targeting,likes,message,permalink,post_id,privacy,share_count,source_id,targeting,type,updated_time,is_published,scheduled_publish_time
from stream where source_id="{page-id}" and (is_published=0 or is_published=1)
ORDER BY created_time
DESC LIMIT 250
And this is what I have now:
{page-id}/feed?fields=id,is_published,scheduled_publish_time,from,description,message,picture,link,name,caption,icon,privacy,type,status_type,object_id,created_time,updated_time,feed_targeting,shares,likes.limit(1),comments.limit(1),attachments&limit=250
The result set from FQL return several post for which is_published = false, while none of them show up with the api call. Obviously, I'm using the same access token for both. I've tried adding some more fields, removing some fields, making the call only for the promotable posts, but no luck. Am I missing something?
EDITED
There's a bug reported on Facebook regarding this in case anyone wants to subscribe:
https://developers.facebook.com/bugs/277633459027605/
It has been confirmed that this is a bug.
https://developers.facebook.com/bugs/277633459027605/
Related
Hi I am using the Facebook graph api tool and attempting to get the feed of a public page. I want to get most recent comments first. However the feed returns comments and replies sorted by "relevance", is there a "sort" I can apply or how do I change this to get recent comments and replies within my posts?
I do not own the page I am getting the feed from.
There's the order parameter for comments, which can have the following values:
chronological
reverse_chronological
See
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.5#ordering
As far as I know, the feed's posts will always be sorted by created_time, and there's no way to influence this via the Graph API requests.
FQL will be obsolete in API 2.1. If any user creates a new APP, then the user is forced to use API 2.1 features, as a result, I need to remove all FQL and replaced with Graph API to server the new users who create a new app.
Here is the quesion, We use FQL to fetch all posts on wall based on updated_time, and then we can fetch all newly comments reply to these posts on the page. This is the way we can fetch all the newer comments since last update. the FQL syntax look like this.
https://graph.facebook.com/v2.0/fql?q=SELECT post_id, comment_info FROM stream WHERE source_id = ' owner ' and updated_time >=' since
Does any one know the equivalent feature in Graph API. I have been looking documents but unable to find it. Please help in coming out an alternate approach to achieve the same functionality, Thanks.
There's unfortunately no equivalent in the Graph API. The since request parameter is relative to the created_time AFAIK.
I am trying to query the FB graph API for all of my posts. I would like the result set to only feature items that I've posted on my timeline. Not other users, and not my likes or comments.
The documentation is extremely confusing and most of the knowledge I've gained is through trial and error. To date, the only proposed solutions to this I've found online require the use of FQL (such as in this similar question: Facebook graph api- how to get user feed,with out posts about likes and comment by the user?) however the FB documentation states that FQL is deprecated and will not be supported in the future so I would like to avoid it. Additionally this is currently structured as a url request and if at all possible, I would like to keep it so.
To date, I've tried:
/[userid]?fields=posts.limit(100).fields( picture, link, created_time, from, message, description, object_id )
which will get me all of my posts with the data fields I require, but it also includes "Likes" and when I "Comment" anywhere - which I don't want.
/[userid]?fields=feed.limit(100).fields( picture, link, created_time, from, message, description, object_id )
which returns only posts - but also includes posts made by others on my timeline (and I don't want those either).
It seems unclear to me if there is any more robust way to work with these different feed types as documented:
https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feed/
Can anyone tell if there is a way to either limit the "feed" edge to only my posts (not including others posting to my timeline) or filter the "posts" edge to remove the "likes" and "comments"?
Instaead of /feed, you can use /posts.
More info here:
https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feed
It's not possible as far as I know to generally apply filters to the Graph API calls, except very little exceptions.
/user/feed is an example (https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feed/#read), where you can specify either with=location or filter={stream_filter}.
{stream_filter} in this case is a result of the filter_key field of the following FQL query:
select filter_key, name from stream_filter where uid=me()
Maybe you can try
GET /me/feed?filter=app_2915120374
which should give you the status updates.
Is there a way to get Recent Activity using Graph API or FQL ? I'm talking about information that is available at this location: http://www.facebook.com/vanityname/allactivity?filter_onlyme=on
I coulnd't find anything in FB API documentation (not surprisingly). Scraping it from the web-site looks complicated as well because it's fetched by calling http://www.facebook.com/ajax/pagelet/generic.php/TimelineProfileAllActivityPagelet which returns very hard to parse content.
In case you guys wondering FQL that I tried is select post_id,actor_id,created_time,message,description,xid from stream where source_id = me()
There is no way to get this information in the API. In addition there is no documentation listed for this either at https://developers.facebook.com
I am trying to retrive posts from a users news feed in which my fan page has been tagged. I'm seaching through stream_tag with FQL but zero results are returned.
Posted a comment on my wall in which I tagged a friend, myself, and my fan page.
Used the Graph API Explorer - developers.facebook.com/tools/explorer/
Used the explorer as one of my apps, and granted every type of permission.
Did the following query:
https://graph.facebook.com/fql?q=SELECT post_id,actor_id FROM stream_tag WHERE target_id = [fan page id]
The following is returned: data: []
This seems to indicate that there is no resaults but I know the tag exists. When I do a query with target_id=me() results are returned, but according to the documentation the target_id can also be a fan page( http://developers.facebook.com/docs/reference/fql/stream_tag/ to craft the query).
How can I create a query that returns posts my fan page is tagged in?
I was trying to do the exact same thing when I came across your post. It looks like there currently is a bug report open that the stream_tag table does not work with when the target is a page.