cannot subscribe FB page to FB app recently - facebook

I have a FB app that works well before. It allows users to subscribe their pages to our app.
Recently, I got the error below when trying to subscribe a page to our app:
'Access to this data is temporarily disabled for non-active apps or apps that have not recently accessed this data due to changes we are making to the Facebook Platform.'
I am using this request url: https://graph.facebook.com/me/subscribed_apps?access_token=xxx
It worked great before but not for now.
However, when I try to submit the same request with the
https://developers.facebook.com/tools/explorer
it works.
Anyone canshow me how can I fix this problem?
Thanks,
Thanh

Have the same issue here. My APP uses Facebook Graph API to import events. Credentials for APP (token) was enabled a long time ago....
Now seems its throwing and error also at https://developers.facebook.com/tools/explorer/1405126029586258?method=GET&path=157956504840454%2Fevents&version=v2.12
Nether my APP or Graph API is working. Below the error message....
{
"error": {
"message": "Unsupported get request. Object with ID '157956504840454' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "EHCB6/XyJsA"
}
}
Same error on my app at Wordpress to import events
Message from Facebook answering the question...
As we begin enhancing our new app review process and make changes to our platform, the Events, Groups, Pages and Instagram APIs will no longer be available to new developers. Testing of our more robust process starts today and the new process should resume in a few weeks, but apps currently accessing Events and Groups APIs will lose access today. Going forward, access to these APIs will require a formal app review and for apps using the Pages API, submission is required within 90 days once app review resumes or access will be removed.
https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes

Related

Facebook APP - How do I make my Facebook App Live

Am new to Facebook related stack. So, please bear if its a dumb question.
I created a Facebook App but I couldn't able to find the option to make my APP Live. Do I need to submit it for review and then only I can able to make it Live?
Also am trying to do a Facebook messaging using send API. Am getting "message": "(#803) Some of the aliases you requested do not exist: messages".
Am I missing something? Please help.
Also am trying to do a Facebook messaging using send API. Am getting
"message": "(#803) Some of the aliases you requested do not exist:
messages"
Your URL should be in this format
https://graph.facebook.com/v9.0/me/messages?access_token=<PAGE_ACCESS_TOKEN>
This means you're missing the /me object in your call. Also since, it's a POST request you need to attach a body with the following params to the call.
"messaging_type": "<MESSAGING_TYPE>",
"recipient": {
"id": "<PSID>"
},
"message": {
"text": "hello, world!"
}
Do I need to submit it for review and then only I can able to make it
Live?
According to the page you linked, you need to request pages_messaging permission and that requires App Review in order for this Send API to work in your app.
Additionally, If you want to test this in development mode, you can give a role to the user(as a developer, tester, or analytics user) you're trying to message and test with them as mentioned on the page you linked:
Apps in Development Mode, are restricted to message people that have a
role in the app. Additionally, Pages in unpublished status will only be
allowed to message people with a role on the Page.

Instagram OAuth API returns "insufficient_dev_role" 400 error

I have a Facebook app in Live mode, that has passed review and has Instagram Basic Display set up, having passed review for the following permissions: instagram_graph_user_profile and instagram_graph_user_media.
According to the documentation, if I visit https://api.instagram.com/oauth/authorize?app_id=[my app ID]&redirect_uri=[My app redirect URL]&scope=user_profile,user_media&response_type=code in a browser and authenticate, I should be redirected back to my redirect URL with a code.
However, if I try that with any user who I have not explicitly set up as an Instagram Tester, I receive the following error, even though my app is in Live mode:
{
"error_type": "OAuthException",
"code": 400,
"error_message": "insufficient_dev_role"
}
Note that another similar question was asked a few months ago - the difference in this case is that my app is in Live mode, and therefore should allow any user to authorise via OAuth, while for the other question the app was still in Development mode, so the issue was adding appropriate Instagram Testers.
This has been identified as a known issue that Instagram is working to fix.

How to get overall star rating of Facebook page from Facebook Graph API?

I am trying to make a very simple request to Facebook's Graph API using this URL:
https://graph.facebook.com/v2.12/1984193321812400?fields=overall_star_rating&access_token=205658113371329|gYdP-nDHNVENlwVxria21Uczgs8
All I want from Facebook is the overall_star_rating of my Facebook page. However, this is what I get:
{
"error": {
"message": "(#200) Access to this data is temporarily disabled for non-active apps or apps that have not recently accessed this data due to changes we are making to the Facebook Platform. https://developers.facebook.com/status/issues/206742313468873/",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "A9XRfTkh3WR"
}
}
Since I am completely new to Facebook Graph API: Is the request I am making correct or am I missing something really fundamental here?
And yes, I read Facebook's issue report, but I don't find it very helpful since I set my app to active already and it's not working anyway.
Thanks for any help in this matter.
Since Facebook is undergoing major changes, they have revoked few access to non active apps. Get the access_token from any frequently used app, your Graph API call is pretty correct!
But the Page ID seems to be wrong, as it shows me error after adding a working token.
Error : "message": "(#803) Some of the aliases you requested do not
exist: 1984192327815400"
After changing the Page ID, and adding active app token, it shows the correct result.

Facebook Graph API rejects newly created access token

Earlier today, the Facebook login flow of our web application stopped working for some users. When we try to fetch the current profile, an error is returned. It claims that the access token we just generated by redirecting the user to the OAuth login flow has been rejected.
The reason given is:
The access token is invalid since the user hasn't engaged the app in longer than 90 days
To me, this makes no sense since we do not store the access token anywhere except for the current session and recreate it every time the user logs in with Facebook.
The stacktrace from Spring Social for the GET /me call looks like this:
ERR c.s.f.v.resource.AuthenticationResource Exception when connecting with Facebook
org.springframework.social.RevokedAuthorizationException: The authorization has been revoked. Reason: The access token is invalid since the user hasn't engaged the app in longer than 90 days.
at org.springframework.social.facebook.api.impl.FacebookErrorHandler.handleFacebookError(FacebookErrorHandler.java:85)
at org.springframework.social.facebook.api.impl.FacebookErrorHandler.handleError(FacebookErrorHandler.java:59)
at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:775)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:728)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:702)
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:350)
at org.springframework.social.facebook.api.impl.FacebookTemplate.fetchObject(FacebookTemplate.java:220)
at org.springframework.social.facebook.api.impl.FacebookTemplate.fetchObject(FacebookTemplate.java:215)
The issue is probably related to changes in the Facebook API, but I do not see how this affects the short lived access tokens we create on every login.
I ran into this issue when our integration tests logged in with a test user - the following JSON came back from the Graph API:
{
"error": {
"message": "The access token is invalid since the user hasn't engaged the app in longer than 90 days.",
"type": "OAuthException",
"code": 190,
"error_subcode": 493,
"fbtrace_id": "F/1z2AsTRx8"
},
"timestamp_microsecond": "2018-05-30 11:22:01.353949"
}
That was a bigger problem as our test users don't "engage" with the app as such. To fix this I had to:
Log into the FB developer site
Find the app in question
Look under Roles -> Test Users to find the right user
Click on the Edit button for the user and then click "Login as this test user"
Once I'd logged in, go to Settings -> Apps & Websites
Find the App in the "Expired" tab for apps the user had not interacted with for longer than 90 days
Click the "View & Edit" button on the expired app
Click "Renew Access" in the popup
Once I'd done all those steps my test user (and integration tests) worked again.
facebook responses:
Thanks for getting in touch. This is actually a known issue that we
are already tracking in another bug report.
I'm going to merge your report with the existing one, so we can deal
with the issue in one place. Please refer to this thread for updates:
http://developers.facebook.com/bugs/194772814474841/
My temporal solution was to use JS SDK, it is working correctly in my case...
Update:
The issue seems to have just been fixed by Facebook.
I filed a bug with Facebook and they are currently (5/3/18) working on a resolution.
There are several workarounds suggested here and in the bug comments. To summarize:
Add a new permission that you previously didn't ask for to force re-authorization
Catch the error and re-authorize the user manually via auth_type=reauthorize
Switch to JS SDK and use client-side login
I'm going for solution #2 as it seems to be the most straight-forward way.
I have found this link in FB docs:
Refreshing User Access Tokens
Which mentions that after 90 days users must re-establish their token, so in case of such error we should just redirect the user to register again.
They even mention that they remove tokens of non-active users in the top of this doc. Maybe they did a mistake and removed all users tokens.
Anyhow the solution is to redirect users to resubscribe.
The bug persist according to discussion
According to a user's comment of mentioned discussion, we revoked permissions of every user of our app and it worked. For this we used next graph api endpoint. We had to persist the users' facebookIDs.
Regards
TEMPORARY SOLUTION
For iOS you need to change SDKs code to support "reauthorize". In order to change source code you will need to download it using CocoaPods. Then copy the following functions over pods:
https://github.com/mavris/FacebookFix
Add Permission Code in your App
Likes
Android :
fbLoginButton.setReadPermissions(Arrays.asList(EMAIL));
IOS:
loginButton.readPermissions = #[#"public_profile", #"email"];

Accessing Facebook Ads API request error 270

I have a whitelisted Facebook App that is out of sandbox mode and has been approved for the Ads API, but I am receiving the following error when trying to make requests to the Ads API.
{
"error": {
"message": "(#270) This Ads API request is not allowed for apps with only developer access",
"type": "OAuthException",
"code": 270
}
}
This occurs when using adgroupstats, adcampaignstats, and reportstats requests, etc. The adaccounts request does return my account information though. My dashboard does read "This app is public and available to all users", as I needed to get out of sandbox mode in order for my app to be whitelisted.
Is there another setting that I have missed in order to gain access to the Ads API calls that I need?
Answer:
This is most likely due to your dev/admin accounts of the app not being set as "Admins" in facebook's ad manager. Let me know if this solves this issue for you.
Old response:
I am running into the same issue. Can not run api calls against reportstats even though the user that the app/ad account belongs too was an admin, i change that user to a developer and its still happening.
I opened a bug report for this: https://developers.facebook.com/bugs/786289188058999