1
votes

I'm trying to get all comments from Facebook Comments Plugin running in my application.

Here's a step by step of what i have done

  1. https://graph.facebook.com/{myUrl}

    {
       "share": {
          "comment_count": 43,
          "share_count": 1695
       },
       "og_object": {
          "id": {myObjectID},
          "description": {myDescription},
          "title": {myTitle},
          "type": "website",
          "updated_time": "2018-05-28T21:50:37+0000"
       },
       "id": {myUrl}
    }
    
  2. https://graph.facebook.com/{myObjectID}/comments?access_token={pageToken}

    {
       "data": [    ],
       "paging": {
          "cursors": {
             "before": {beforePointer},
             "after": {afterPointer}
          },
          "next": {nextUrl}
       }
    }
    

So despite comment_count = 43, data field is empty. It's also weird that a {nextUrl} is given although not showing any results.

Haven't found nothing about this in the recent update due to GDPR.

Any ideas?

1
Can’t find anything mentioned either; but seeing how they disabled/limited access to user details on comments in other places (pages, groups), I would not surprise me if this was in the same spirit. With a page or a group there is a way to prove you have admin access, but for external URLs - not really. - CBroe

1 Answers

0
votes

The graph API has changed recently due to privacy and GDPR concerns.

To get all comments for a page or user first you need to make a call to get all your posts and then make a call for each post to get comments.

Please view the following example end to get all the posts and then post_ids (the call is similar for user posts).

https://graph.facebook.com/v3.2/{pageId}/posts?access_token={accessToken}

post_id looks something like this - 5704324444475_570454233326 and is in the id field of each returned post.

Then call the get comments endpoint from the graph API using the ID(s) returned by the first endpoint.

https://graph.facebook.com/{post_id}/comments?access_token={accessToken}&summary=true

You'll need to make a separate call for each posts to get that post's comments.