Permission denied when getting comments from my page via FB Graph API

Viewed 617

Just recently, my attempts to get comments of my post via API fails with Permission denied. I'm pretty sure that it worked before (early Aug 2021).

I'm able to get posts of my page (in both API and Graph Explorer) via /ID/posts but I'm not able to get user generated content via /ID_POST/comments. I got

{
  "error": {
    "message": "(#200) Missing Permissions",
    "type": "OAuthException",
    "code": 200,
    "fbtrace_id": "AQuGaEEWWkJ_L380WhfeDPy"
  }
}

but I have page token with pages_read_engagement, pages_show_list, pages_read_user_content (what should be enough by itself). The application is in production mode and business account is verified. So additional approval of permissions should be not be required.

What am I doing wrong?

3 Answers

I had the same issue. The reason was because I didn't have "community activity access" to the page in question in business manager.

You can see if you have this by going to Facebook Business Manager -> Business settings -> Accounts -> Pages -> {your page that you want to pull comments from} -> {your profile}. You will then see some toggles. If you can (you may need extra permissions from the page owner) you will need to toggle either "community activity" or "manage page".

Once I did this, I had no issue pulling comments. I also found that I needed to use a page access token rather than a user token or app token.

You can try these permissions that I use to get all comments on my page..

  • pages_read_engagement
  • pages_manage_metadata
  • pages_read_user_content
  • pages_manage_posts
  • pages_manage_engagement
  • public_profile

Also make sure the application type is in Business. Trust me, you can get all comments and posts from someone on your page, except their profile name.

check this: graph result

Related