When trying to get the feeds from facebook with comment with this query:
feed?fields=id,from{id,name,link},message,link,type,created_time,source,caption,description,name,story,picture,full_picture,shares,object_id,status_type,likes.summary(true).limit(0),comments.filter(stream).summary(true).order(reverse_chronological){id,attachment,created_time,from{id,name,category,link},like_count,message}
returns the comments author information up to version 2.10 but it does not return that info when using version 2.11. Any ideas of how to solve this?
You are most likely using an App Access Token. In order to get the user info, you need to use a Page Token now. Of course you need to manage the Page to get a Page Token. Read about this in the changelog: https://developers.facebook.com/docs/graph-api/changelog/version2.11#gapi-90
Related
I am trying to use the Facebook Graph API to GET Instagram metrics such as post impressions. I was able to successfully pull my Instagram Follow Count by using this query
{instagram_user_id}?fields=follow_count
When I try to query my post impressions with
{instagram-media-id}/insights?fields=post_impressions
nothing shows up. Am I missing something or have I possibly not requested the correct permissions?
I am trying to follow the documentation at the below link. Is it even possible to pull the impressions through the Facebook Graph API?
https://developers.facebook.com/docs/graph-api/reference/instagram-media/insights/
Thanks!
I believe that it wasn't possible to pull insights using the older version of the API.
However now it is possible as instagram / facebook just released a new version of their Graph API that includes insights. The request would be:
v2.10/{instagram_media_id}/insights?metric=impressions
The new documentation can be found here
Have you tried to specify "period" parameter? By default it might not be a "lifetime" and if you did not generate any impression recently you will see nothing (empty array i assume). In case you missing some permissions, Facebook will make you aware in response.
I am admin on an FB group and I want to get a feed of the latest posts for inclusion in a website. How do I do this? Excuse the simplicity of the question. However, I have done some research and I understand that I need an access_token, but do I really need to do some full oAuth stuff for a public group?
Yes you have to put access token to get feed but no need to worry this access token can't share your any details.it just a token to get feed.
You can generate your access token no. here.
https://developers.facebook.com/tools/explorer/?method=GET
And you can get feed for your page with following url:
https://graph.facebook.com/PAGE_ID/feed?access_token=ACCESS_TOKEN
Thanks
I want to get my news feed (just as what is shown on facebook home page) using Facebook graph api
https://graph.facebook.com/me/home
However, the facebook api document says that
this is an outdated view, does not reflect the News Feed on facebook.com:
Are there any other ways ?
Thanks in advance
Yes there is
https://graph.facebook.com/[YOUR_ID]/home
Note though that you will get almost everything you see on your news feed by most recent order and not by Top Stories order which is the default view you get when visiting your own news feed.
Also another thing to note is that you wont get promoted stories in the results.
For all wondering if this still works:
graph.facebook.com/[YOUR_ID]/home
You need the permission read_stream for this. But you wont get this permission, because its deprecated.
Unfortunately the endpoint https://graph.facebook.com/[YOUR_ID]/home and the permission are deprecated and dont work anymore since version 2.4, according to the changelog (search for read_stream).
Currently there is no alternative for reading the news feed. Only the user's posts can be obtained.
See this for reference: Get Home feed requires read_stream which is deprecated?
I am using the RestFB client to fetch all post_ids of a Facebook Page.
The query is
select post_id from stream where source_id=265813166783408
Where the id if of the page I'm querying. It can be found here
I initially tried executing this without an access token. This gives a 104: Requires valid signature error from Facebook.
I looked up this error and the solution that many gave on SO is to use an access token. However if I try with an accessToken (with permissions: manage_pages, publish_stream, read_stream, offline_access, read_insights) then Facebook gives a different error 190: Impersonated access tokens can only be used with the Graph API.
Does this mean I shouldn't use FQL for getting page posts. The Facebook documentation doesn't mention anything on these lines but like I said it keeps alternating between these two errors.
PS: I can use the Graph API with my access token to fetch Posts but for my specific scenario I felt FQL would be a far better option, since I can nest this query into a query on the comments table (eventual aim).
Thank you.
UPDATE:
Please see Facebook developers for a discussion on this particular issue If you are using the RestFB library then also see the relevant issue
We encountered the same problem and found it to be an issue with using fbclient library and a page access token. We switched to calling the API directly (with the Apache HttpClient) and our FQL ran fine with the page access tokens.
How do you query facebook's graph api via the javascript sdk for users that have allready given you permissions (offline access) and whose auth data you have stored, but who are not currently logged in to facebook?
To answer my question, you can in fact do so. You can use FB.api calls and include the access token at the end of the URL with ?access_token=
I'm not 100% sure of the code you'd need to actually do it, but I think one of the key elements to this would be logging in to the SDK as an application, rather than a Facebook User, as detailed in the documentation # http://developers.facebook.com/docs/authentication
Have you got an example query that you'd like to make with the SDK?