Facebook graph "/me/photos" endpoint requiring 'Page Public Content Access' - facebook

We've had a facebook app which access the authorized user's photos. It uses user tokens.
It had been working for a long time. In the last few days, requests to the graph endpoint me/photos has started giving us an error stating the endpoint requires 'Page Public Content Access'. I can also reproduce this in the graph explorer. Note: it only occurs if I refresh user token, the older tokens seem to work.
We're not attempting to access a public page so this error doesn't seem to make sense. We're only accessing the "me" page and the user token has the user_photos permissions.
Is this error a facebook bug? Do we need to change how we call the graph? Do we need this permission (would prefer to not request it since it doesn't sound applicable to a user-token based app accessing "me" page).
Thanks in advance.
Exact API and error can be seen below:

Weird glitch, and one I can’t personally reproduce.
(And even if the token was a page token, that error would not make sense. /me with a page token automatically resolves to the page the token is for, so this could not be “public access” to begin with.)
There’s already a bug report for this, https://developers.facebook.com/support/bugs/315161742450138/ - though it is currently in “needs more info” status. Maybe subscribe to that, then you will get updated when there’s anything new on this. And you can also comment there, if you have info to add.

Related

Getting "(#100) Pages Public Content Access requires either app secret proof or an app token" issue when calling Facebook API?

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,
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?
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... -.-
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. :)
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.

Facebook permissions changed. User_photos no longer sufficient. 'Page Public Content Access' addition [duplicate]

We've had a facebook app which access the authorized user's photos. It uses user tokens.
It had been working for a long time. In the last few days, requests to the graph endpoint me/photos has started giving us an error stating the endpoint requires 'Page Public Content Access'. I can also reproduce this in the graph explorer. Note: it only occurs if I refresh user token, the older tokens seem to work.
We're not attempting to access a public page so this error doesn't seem to make sense. We're only accessing the "me" page and the user token has the user_photos permissions.
Is this error a facebook bug? Do we need to change how we call the graph? Do we need this permission (would prefer to not request it since it doesn't sound applicable to a user-token based app accessing "me" page).
Thanks in advance.
Exact API and error can be seen below:
Weird glitch, and one I can’t personally reproduce.
(And even if the token was a page token, that error would not make sense. /me with a page token automatically resolves to the page the token is for, so this could not be “public access” to begin with.)
There’s already a bug report for this, https://developers.facebook.com/support/bugs/315161742450138/ - though it is currently in “needs more info” status. Maybe subscribe to that, then you will get updated when there’s anything new on this. And you can also comment there, if you have info to add.

Unsupported get request error (code 100) with Facebook Graph API Ads reachestimate call

When making requests to the reachestimate endpoint in the Facebook Ads API (v2.4), we are receiving an "Unsupported get request" error (code 100) for some users, whereas it works for the majority. Here's what I know:
The requests are well-formed. We are providing the access token, ad account ID, currency, targeting spec, and API version. Except for ad account ID and access token, the parameters are identical between working and non-working requests.
According to the access token debugger, the access tokens are valid, never expire, and contain the ads_management scope.
I am able to use the same access token to successfully retrieve the Facebook page being promoted.
One theory was that perhaps the users did not have permission to view the pages that were being promoted. To test this, I added an alcohol restriction to one of the pages for which the reachestimate call did work, and changed the user's age to 20. I also blocked the country in which that user was located. The reachestimate call continued to work for that user, so thus that did not reproduce the issue.
Facebook seems to be providing a generic error that does not help determine the problem. I'm looking for any other ideas as to what it could be or how to identify it.
I recommend you to file a bug at https://developers.facebook.com/bugs/
And you should attach the full response including a field called fbtraceid in the bug. In this way we are able to looking to what happened to you.

Facebook Application Token

I create a demo application to request photos from facebook. I created an application token like this : 549933848476397|4a584ce5fda19cba2ed6630ed78ba8f4. But when use this request URL https://graph.facebook.com/1417833425116725/photos?access_token={app_id}|{app_secret}. It's does not work. Please help me. Actually When I use user token for this request, It's work ok.
If the Page is restricted somehow (age, location), you can only use a User or Page Access Token to get data like photos of the Page. The App Access Token got no relation to any User, so Facebook can´t detect if the User is even allowed to see the Page.
I am 100% sure the Page is restricted btw, you get an "Unsupported get request" error when trying to access the Page ID directly with the Graph API, and that usually happens when the Page is restricted.
Just try another Page with that exact same App Access Token, for example:
/bladauhu/photos
...works without any problem. Another sign that your Page is indeed restricted.
TL;DR: For this specific Page, you MUST use a User Token or Page Token.

What is the proper way of accessing a public post from a facebook page

I have a CMS application which needs a little component that allows an editor to select a facebook page post to display.
I've been going around facebook API and I don't fully understand what is the proper way of doing it.
This would be a server call, I would prefer not to have an access token because I am not making the request on behalf of any user.
I've tried using access_token=app_id|app_secret, but apparently that request requires an user session. So I went to the graph explorer and copied my access token. That worked fine initially but then I learned that they expire. I could get a long live token, but apparently those also expire eventually.
So, what is the best way of doing this? I think that using someones facebook access token for this is risky. The token could be revoked at any point breaking the feature in production. Can I achieve this without an user access_token? if I cant, how is this token normally managed?
Update:
Well actually the app_id|app_secret works, just not in every case. I created several pages for testing purposes and it doesnt work in any of them. Then I tried accessing a post from some brand pages (unrelated to my project) and they work ok. So my problem is configuring the page.
When I tried to access the post using app_id|app_secret I get:
(#100) Requires user session
Posts are public in all cases
I already tried to assign a vanity url to the page, no change
I think it's not possible to use just an App Access Token to get the Page Posts. Unfortunately the docs are not very clear on this IMHO:
https://developers.facebook.com/docs/graph-api/reference/v2.2/page/feed/#readperms
An access token is required to view publicly shared posts.
A user access token is required to retrieve posts visible to that person.
A page access token is required to retrieve any other posts.