Facebook API for Share returns empty result set

I am new to Facebook API. I am building a Facebook app to get all the names of people who have shared, commented and liked a post in a tabular format. I can get information and comment on details through the Facebook API, but I can't find the proper API for sharing information either.

I use

https://graph.facebook.com/post_id?fields=sharedposts&access_token=my_access_token .

This API returns an empty result set. And I have granted all the access_tokn permission available. Can anyone tell me if there is any other API that I can use. I've seen the option to scrape the Facebook page for sharing, but I don't want to go that way because Facebook keeps updating everything.

+2


source to share


2 answers


I have the same problem as you, but I think I will take a small step forward. Try adding a limit to your shared folders and maybe it will return some data: Try like this:

https://graph.facebook.com/post_id/sharedposts?access_token=my_access_token&limit=1000

      



This should work for regular posting.

EDIT: Maybe the problem might be that although you have provided all perms for the token, the people who share these posts must accept that permission too. Otherwise, your JSON will not return any data.

+3


source


The endpoint /sharedposts

will - only receive messages from users who have also provided your application. This means that even if a message might be public in the users' timeline, unless they have granted permissions to your app, you won't be able to receive that message.

For example: a user posted to a page and the post is public. This post can be obtained using an access token. Let's assume the user also shared this post with their own timeline. But since the user hasn't granted permissions to your app, you won't be able to see this message using the edge /sharedposts

in the original post (on the page). This is also the case if the user publicly posted their post on their timeline.



This behavior is by design; The API is more restrictive on the return of user data than the website. This is true for multiple endpoints, and this is one example where this is the case.

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

+1


source







All Articles