4

I stumbled upon a problem with the Facebook Graph API today. I simply tried to get all the comments from a specific post: https://www.facebook.com/IGABerlin2017/posts/396682000447623

But the Graph API Explorer returns only one comment: /167505403365285_396682000447623/comments

Is this a privacy issue? Is there any way for a user to set his or her comments invisible for public API calls?

I even requested all the available permissions when generating the access token... well, without success. This is a public page (and post) and there shouldn't be any problems with permissions...

Thanks for any help in advance.

kriskbx
  • 107
  • 2
  • 8
  • Try to look at this answer, seems really similar: http://stackoverflow.com/questions/4393137/not-all-the-comments-visible-when-pulling-a-post-using-facebook-graph-api-iphone – Alessandro Gabrielli May 27 '13 at 13:57

2 Answers2

1

It's not a facebook API bug. The main cause is because you can't even access 'https://graph.facebook.com/wauwaumax' to get basic profile info, you would get error message instead:

{ "error": { "message": "Unsupported get request.", "type": "GraphMethodException", "code": 100 } }

It's possible when user turn the platform off on app settings.

Before turn it off:

enter image description here

After turn it off:

enter image description here

Any third party apps including Graph API explorer would no longer able to access user data via any API call after user turn it off.

林果皞
  • 7,539
  • 3
  • 55
  • 70
0

comments are public when you comment on a public post. May I see the code you're using? Or is it just an attempt with the graph explorer? Anyhow I've seen this answer on SO that might help Retrieve Facebook Post Comments Using Graph API

EDIT: I have managed to do this with FQL on the Graph Explorer. It seems to works properly with the following

SELECT post_id FROM stream WHERE source_id=FAN_PAGE_ID AND comments.count > 0

You'll see the posts listed by id number. Just click to see likes and comments for each post. If you prefer the graph you can simply write the comment ID with GET to see all comments and likes: Alternatively you can write

POST_ID_NUMBER/comments/data

to get comments only. I hope this helps.

Community
  • 1
  • 1
tattvamasi
  • 845
  • 1
  • 7
  • 14
  • I'm just using the API Explorer right now for testing purposes. There's no actual code yet. I stumbled upon your linked answer before and it doesn't helped me out. Thanks anyway. – kriskbx May 27 '13 at 13:51
  • I've edited the answer with a solution that worked for me. It's POST_ID/comments/data – tattvamasi May 27 '13 at 13:52
  • Okay, I think you misunderstood the question. There's no problem retrieving comments. There's a problem retrieving **all** the comments. Look here: https://www.facebook.com/IGABerlin2017/posts/396682000447623 There are 3 comments. It's a public post on a public page. And now try this: https://developers.facebook.com/tools/explorer/?method=GET&path=167505403365285_396682000447623%2Fcomments The result is only one comment. Even if I use your suggested /comments/data: https://developers.facebook.com/tools/explorer/?method=GET&path=167505403365285_396682000447623%2Fcomments%2Fdata – kriskbx May 27 '13 at 13:57
  • but with FQL or the Graph Explorer that I got all comments...Can it be something with the token? You've got to use a valid token in all queries – tattvamasi May 27 '13 at 14:12
  • I'm only able to get the first comment. The other 2 comments /from the same guy) are missing tough. I tried several accounts and regenerated the token a few times. Actually the token provided by the Graph Explorer should be valid... prove me if I'm wrong. – kriskbx May 27 '13 at 14:35
  • no you're right actually! I am afraid you need authorization from the page admin (which would be slightly pointless, give that that's public information). I tried it with my fan pages and my app on graph explorer. Of course I have already authorized the app so I have no problems. It can be that, or a bug in the new comments - you know that now you can comment on comments so that might have influenced the system? Just hypotheses – tattvamasi May 27 '13 at 17:07