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

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.

Related

Facebook Graph API not working with comments?

I created a page and an app with a Facebook Developer account.
In the Explorer Tool, I can retrieve a list of posts with this query without any issues:
104801368572889/feed?fields=message,attachments&access_token=[token]
However, not so lucky when I try to retrieve the comments associated to a post with this query:
104801368572889_105680201818339/comments?access_token=[token]
That's the error I get:
{
"error": {
"message": "(#200) Missing Permissions",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "AOmx5mNZC9xUFysAWp4oX3s"
}
}
It sounds like this means I don't have permissions. I tried to add all the possible permissions in the Explorer Tool (included the pages_read_engagement that is probably the one required for this API call). However, this doesn't seem to work. I also tried to add permissions in the app from the Developer Dashboard, but this brings me into a long process of information requests and reviews by Facebook. I don't want to go through this process as I'm just doing development at the moment. Isn't there something as a sandbox or development mode, where I can set the permissions that I want?

Facebook Graph API Business page missing permissions

I have created a facebook business page and i want to get some posts over the graph api.
I have set everything up (Developer App, Token...).
I get this error when I make an http request:
{
"error": {
"message": "Unsupported get request. Object with ID '492303394120348' 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,
"fbtrace_id": "DxgFcxGEl2Y"
}
}
When i am using the page-id of another facebook page it is working.
What is the problem here. Can someone please help me?
App Tokens are not a good way to access a Page with the API. If the Page is restricted by age or location, you need a User Token of a user who is able to see the Page, or a Page Token of that Page. You should always consider using a Page Token.

Facebook Ads Insights API: (#3) Application does not have the capability to make this API call

I am trying to pull Facebook Ads metrics through the Facebook Marketing API. The flow is basically that I wish to pull all the account ids of my company, and then loop over them, retrieving the insights for them individually.
However I have an error which I am not able to solve/comprehend.
When I attempt to make the API call (both in the Graph Explorer and my Alteryx workflow):
GET-> /v2.8/act_<Account_ID>/insights
I get the following error:
"error": {
"message": "(#3) Application does not have the capability to make this API call.",
"type": "OAuthException",
"code": 3,
"fbtrace_id": "BNevVWUExDg"
}
I must admit that I am quite at a loss what is causing this error...and actually also exactly what the issue is...am I lacking the right scope/permissions for my token?
With the same token I am able to correctly call the API to get a list of all adaccounts (GET-> /v2.8/me/adaccounts ).
Anyone have an idea what my issue might be?
You have to make sure that your particular access token has the permissions ads_management or ads_read.
This is from the Marketing API quickstart. https://developers.facebook.com/docs/marketing-apis
There are also rate limits on those API's, but I would expect a different error if that was the case.
I ran a POST instead of GET on the same endpoints, which gives me another error about not being admin on the account.
It appears that the user associated with the token (which is a long lived one) was only having analyst access to the account in Business Manager. After I changed it to advertiser it seems I can do the GET call.
In my case, I added a new development user in the roles page. Then I was trying to do OAuth. I got the error message "Application does not have the capability to make this API call."
Here's the way that I solve the problem while your application still in the development mode.
Go to Marketing API > Tools
Then select what token permissions you want. Press "Get Token" button.
Now, you can try to do OAuth again.

Facebook app token not working, but access token works

I have a really weird situation here, and I've looked everywhere through Facebook's documentation with no answers.
I'm trying to get get recent posts from multiple Facebook pages. But one of them keeps crashing. It won't work when I'm using an app token. It works if I'm using access tokens, but those expire, so it'd be better to not use that.
https://graph.facebook.com/norgeshushonefoss/posts?access_token=myAppToken
gives this result:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
While this url gives me the recent posts: https://graph.facebook.com/norgeshus/posts?access_token=myAppToken
I can't see any difference in those two. Are there any page settings that may cause an app token not to authorize for some reason?
If the page has any access restrictions in place (age, location, alcohol-related content), then you can not access any of its info using your app access token.
It needs a user access token for a user that qualifies to see the page (or a page access token).

Facebook Graph API "/{page-id}/feed" is not working with App Access Token

We are facing issues with Graph API. The Facebook Graph API "/{page-id}/feed" is not working for all pages with a valid App Access Token. Previously it used to work. We noticed it today the API is throwing error
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1
}
}
Not working pages:
https://graph.facebook.com/22934684677/feed?access_token=
https://graph.facebook.com/42798291365/feed?access_token=
Note: And its working if we pass a User Access token instead of App Token.
Facebook developer Docs says "An access token is required to view publicly shared posts." So App Access Token should work!
Does Facebook change something inside the API?. Can any one help to solve the issue
You should use a Page Token for Page data. Pages not working with an App Token are most likely restricted by age or location. Since the App Token does not include any user session, you canĀ“t be sure if the user should have access to it.
If it does not work with an App Token AND the Page is definitely not restricted, file a bug.
This is happening because some of the posts returned might have extra restrictions on them which need a user token to verify this. Use a page token or a user token as a workaround for this. Having said that, the request shouldn't fail with an unknown error and we're working on a fix for the same on the bug report here:
https://developers.facebook.com/bugs/783169051760311/