Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graph API sharedposts edge empty data issue

I'm facing a problem with /sharedposts edge it keeps returning empty array {"data": []}

I'd like to share my case exactly with you, may be I'm doing something wrong.

  1. I'm using Graph API Explorer / API ver 2.3
  2. I'm trying to track a fan page post, and get the users' ids who shared this post
  3. The page post is public
  4. All the sharing is public too
  5. My application has read_stream permission granted (at least on the testing users)
  6. I even tried that when I'm the page Admin, App Admin, and I did the sharing myself to my timeline, all permissions are granted and I added manage_pages permission.
  7. I tried using the {post_id}/sharedposts
  8. I tried using the {page_id}_{post_id}/sharedposts
  9. Based on other posts in this regard on StackOverflow, I added limit.

All the above trials, keep giving me the same results

{"data": []}

Please advise me what's wrong with my App, please if anybody has a successful experience with this issue please share, or advise me where could I find the problem?!!!

like image 539
Doaa Magdy Avatar asked Apr 07 '15 16:04

Doaa Magdy


2 Answers

There seems to be a known bug with this API endpoint. The behaviour you're describing is the same as in this bug report: https://developers.facebook.com/bugs/1404733043148335/

like image 120
subeeshb Avatar answered Nov 03 '22 09:11

subeeshb


The /sharedposts endpoint will -only- retrieve posts from users who have -also- granted your app. This means that even though a post might be public on a users' timeline, unless they have also granted your app permissions, you will not be able to retrieve that post.

For example: a user posted to a page and the post is public. This post can be retrieved with an access token. Let's assume that the user also shared this post to their own timeline. But, since the user has not granted permissions to your app, you will not be able to see this post using the /sharedposts edge on the original post (on the page). This also holds if the user shared their post publicly to his timeline.

This behaviour is by design; the API is more restrictive in returning user data than the website is. This holds for multiple endpoint and this is one of the examples where it is the case.

like image 33
Virendra Singh Avatar answered Nov 03 '22 08:11

Virendra Singh