Retrieving facebook user frameworks via the graphical API

I am currently working on a facebook application that captures wall posts for a specific user, page or group after the user has authorized the application. I quote access_token which is returned to call the method

https://graph.facebook.com/ / feed? access_token =

this works great for pages and groups, since we only need a valid token, however for users the results are different, depending on the relationship between the user, the authorized application, the user whose records are being written.

For example, if there is no connection between the two users, some messages are not returned, even if they are public and displayed when viewing the user profile, however, if they are friends, more messages are returned.

Can someone explain this behavior? And is it possible to get all messages using this method?

+4
source share
4 answers

Yes, for the permissions listed at https://developers.facebook.com/docs/reference/api/permissions , the results of the call vary depending on the relationship.

However, when everything is publicly available, and you use an access token that does not belong to the user, the results are not returned. I cannot remember the time when this was not so. For some odd reason (by design or omission in the part of Facebook), using the graph API to access public messages using the user's access token does not require work.

For example, here you can see some public elements.

http://www.facebook.com/zuck http://graph.facebook.com/zuck

However, you cannot get any feed from here without an access token

https://graph.facebook.com/zuck/feed

{ "error": { "message": "An access token is required to request this resource.", "type": "OAuthException" } } 

Try adding an access token to a user who does not belong to zuck or to a zuck friend. https://graph.facebook.com/zuck/feed?access_token= {UserAccessToken}

And here is what we get:

 { "data": [ ] } 

What about application access token? Try it https://graph.facebook.com/zuck/feed?access_token= {AppAccessToken}

 { "error": { "message": "Invalid OAuth access token signature.", "type": "OAuthException" } } 

So, as you can see, it's hard to get things through a schedule that does not match your access token.

+6
source

I manage to get most of the feeds from the user's bed. Although this is an old post, I hope that someone will be able to get what they want from my answer.

Before you get an access token (in order to get channels), you need to add some correct Read Permissions . For example, you will need to add “ read_stream " and " user_status " (I found that this is the key of the most important permission to create the correct access token, to get one so-called "public" channel).

You can add more to the creation of an access token, either to allow GET, or for POST, or BOTH.

Source located here: https://developers.facebook.com/docs/howtos/ios-6/#nativeauthdialog

One thing I found is a way to get feed results from the Home / About page and the Facebook Page (which is made for people who like (not add friends)). The key is indicated above: " read_stream " and " user_status ". Therefore, it is better to add both permissions to create an access token in order to get everything in the channels.

+3
source

The Graph API does not return messages to the application if it is not allowed to read the user feed, even if the messages are public.

Source: https://developers.facebook.com/bugs/290004301178437/

+1
source

According to the latest api,

 FB.api("/me/feed","get",function(response) {//callback}) 

should work well. It works now, but facebook may change it in the future.

0
source

Source: https://habr.com/ru/post/1392843/


All Articles