11

I am developing an app that syncs with users Facebook account and fetches Facebook page information. Initially, app asks for Login with Facebook and gets page list. After getting pages I am calling API to get posts associated with each page. Once I get post details then I am calling insight APIs to get insights of each post. This flow working fine with development mode but when I switch to Live mode I am getting the following error

      Client error: `GET https://graph.facebook.com/v4.0/100575944711552/feed` resulted in a `400 Bad Request` response:{"error":{"message":"(#100) Pages Public Content Access requires either app secret proof or an app token","type":"OAuthE (truncated...)
 {"userId":1,"email":"superuser@corals.io","exception":"[object] (GuzzleHttp\\Exception\\ClientException(code: 400): Client error: `GET https://graph.facebook.com/v4.0/100575944711552/feed` resulted in a `400 Bad Request` response:
{\"error\":{\"message\":\"(#100) Pages Public Content Access requires either app secret proof or an app token\",\"type\":\"OAuthE (truncated...)

From the details what I observed I am getting this error while using,

GET /v5.0/{page-id}/feed HTTP/1.1
Host: graph.facebook.com

this endpoint. I am currently having 2 permissions approved,

  1. manage_pages 2. read_insights and app review team rejected 2 permissions saying the request is invalid and for this use case we don't require this which are, 1.Page Mentions 2. user_posts

Can anyone help me to understand what is the exact issue?

zoltansn
  • 67
  • 1
  • 12
Nilesh Bhagate
  • 191
  • 1
  • 1
  • 11
  • Did you actually _grant_ the permissions as your page admin user, after putting the app in live mode? What type of token are you using? – 04FS Nov 15 '19 at 12:00
  • Yes, Page have admin rights. I am using 2 types of token page access token and user access token as per requirement but for page we getting error i am using user access token. – Nilesh Bhagate Nov 19 '19 at 04:41
  • You should use the page token, to post as a page. – 04FS Nov 19 '19 at 07:24
  • Some API calls need an `appsecret_proof` along with all relevant permissions. See their [Securing Requests](https://developers.facebook.com/docs/graph-api/securing-requests) docs. – shad0w_wa1k3r Jul 03 '20 at 11:05

3 Answers3

10

I had the same problem. Upon reacting to their damn changes yet again (manage_pages is not a thing anymore). I only had pages_manage_metadata but not pages_read_engagement to actually read the content on the page... -.-

  • 2
    I can't believe this is not in the official documentation – eli.rodriguez Mar 11 '21 at 23:47
  • 1
    As a note, if you also want the /feed to contain posts generated by Users on the Page, you also need approval for [pages_read_user_content](https://developers.facebook.com/docs/permissions/reference/pages_read_user_content) – soniaseguz Apr 29 '21 at 07:36
4

I also appear this error. for me, I found that since graph api v5.0, request has changed. The docs said:

Page Public Content Access

This change applies to v5.0+

Requests made to endpoints that require the Page Public Content Access feature must be made with either an App Access Token or include the app's App Secret. If the calling app has been granted the manage_pages permission however, an app access token or app secret is not required.

If you only retrieve public data. You can use requests by app access token quick fixed. But if you want to get more. You need to follow the docs update. :)

Community
  • 1
  • 1
IkarosKun
  • 463
  • 3
  • 15
  • 1
    can you just guide me where can I add access token or app secret. while authentication facebook permissions like permissions: [.publicProfile]. manage pages is not available – Naqeeb Dec 18 '19 at 05:47
  • 1
    You can follows this `https://developers.facebook.com/docs/graph-api/securing-requests` to add a parameter `appsecret_proof`。 If only public you can use app token. follow this doc `https://developers.facebook.com/docs/facebook-login/access-tokens#apptokens`。 – IkarosKun Dec 19 '19 at 05:19
3

I have fixed this issue. Everything is fine but the only issue is when authenticating with facebook login I needed to include "manage_page" permission in scope section.

Nilesh Bhagate
  • 191
  • 1
  • 1
  • 11
  • 2
    Do you mean manage_pages? Are they different? Do you think it is facebook bug? – tanza9 Dec 09 '19 at 10:41
  • No, I mean even if our account is approved by facebook for manage_page permission, we need to include manage_page permission in scope section on facebook login authentication button. Then only we can access the page insights and posts. – Nilesh Bhagate Dec 10 '19 at 11:05