Does Facebook Graph API have a health-check endpoint? - facebook-graph-api

I am working on an application which primarily expects the Facebook Graph API (specifically FB Marketing API and FB Insights API) to be available 24/7.
However, for most of the day today, the Facebook Graph API has been having lots of "503: Server Error: The server cannot process the request due to a high load."
I would prefer to perform a health-check before requesting an asynchronous job request to generate an FB app marketing report.
Suggestions welcomed!
Thank you.

As far as I know Facebook does not reveal much information about its API health status.
The only information you can get can be fetched via https://www.facebook.com/platform/api-status/ which returns the following data:
{
"current": {
"health": number which indicates the health, the lower the better,
"subject": "text information about current action, problems etc."
}
}

As I'm learning during this major Facebook outage on Thanksgiving Day 2019...
https://developers.facebook.com/status/dashboard/ is not reliable.
On that page, I've had "Get Email Updates" set to Yes for years, but I've never received emails about issues (such as the major outage right now).
In addition, that status dashboard page currently (inaccurately) says:
https://www.facebook.com/platform/api-status/ similarly has been saying:
{
"current": {
"health": 1,
"subject": "Facebook Platform is Healthy"
}
}
And my personal Facebook page fails to load, hanging like this:
What I realized eventually was that visiting https://developers.facebook.com/status/dashboard/ in Chrome Incognito (cache cleared, not logged-in) produced a different page, which led me to see that they've acknowledged today's major issues since "Today at 6:45 AM": https://developers.facebook.com/status/issues/2287293591515186/
{
"current": {
"health": 2,
"subject": "Increased error rates across the platform"
}
}

Related

Why does my youtube data v3 exceeded quota error

So I'm making a get request to the youtube api and this is the response:
{
"error": {
"code": 403,
"message": "The request cannot be completed because you have exceeded your quota.",
"errors": [
{
"message": "The request cannot be completed because you have exceeded your quota.",
"domain": "youtube.quota",
"reason": "quotaExceeded"
}
]
}
}
The problem is that I haven't used my quota at all for at least 2 months and as shown below there is indeed 0 usage. But I still get the above response when trying to access the api.
Can anyone help me?
Thanks in advance.
Based on your description of the issue and the screenshot shared, most probably your project has been disabled or restricted due to inactivity. Here you can find a document with the "Youtube API Services - Developer Policies" [1].
In section D clause 4 you can find the part related to inactivity and the restriction of quota:
"YouTube reserves the right to disable or curtail your access to, or use of, specific YouTube API Services if your API Project has been inactive for 90 consecutive days. For example, YouTube could revoke your API Credentials, or reduce (or eliminate) your API Project's quotas for specific YouTube API Services. If your API Client's quota is reduced or eliminated, you may reapply for quota or a quota extension, and YouTube will review that application based on YouTube’s determination of your expected use of the YouTube API Services."
[1] https://developers.google.com/youtube/terms/developer-policies#d.-accessing-youtube-api-services

Does Facebook's Graph API Explorer currently not allow for the scraping of visitor posts from a page?

I am trying to collect visitor posts from the page of a political party. Even though I can collect the statuses posted from the political party itself, when I request a token for visitor_posts, I get the following error message:
{
"error": {
"code": 1,
"message": "Please reduce the amount of data you're asking for, then retry your request"
}
}
When I then add a limit, I get the same error message, even when I set the limit as 1, 10, or 100. After googling around, people then suggested to add a since/until, since there would be such a high number of visitor posts. However, when I tried that, it also did not work. Has Facebook changed its API to block this kind of collection?
Thanks in advance.
The endpoint [page]/visitor_posts is still functioning correctly, though there are prerequisites for calling it. Assuming you are a page management app, your access token must have manage_pages and pages_show_list scopes.
It isn't necessary for you to use a page access token to make this call and the request can be made with a user access token. It's also not necessary to have any permissions or specific roles on the page you are querying.
Since you are having issues with too much data being returned, although including a limit didn't help, you may help their query engine out by providing a since parameter. This is a filter for posts since a certain unix (seconds) timestamp, example using 12:00 AM UTC today:
[page]/visitor_posts?since=1523318400

Permission_Denied [google cloud platform]: This API method requires billing to be enabled

i am using google cloud platform's vision API
to request the api i am using API key provided by them
authentication documentation in this link i a m authenticating using API key
when i POST URL along with the API Key the following response arrived.
{
"error": {
"code": 403,
"message": "This API method requires billing to be enabled. Please
enable billing on project santram-194814 by visiting
https://console.developers.google.com/billing/enable?
project=[my-project-name] then retry. If you enabled
billing for this project recently, wait a few minutes for
the action to propagate to our systems and retry.",
"status": "PERMISSION_DENIED",
"details": [
{
"#type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developers console billing",
"url":
"https://console.developers.google.com/billing/enableproject=[my-project-name]"
}
]
}
]
}
}
i crossed checked my Console's Billing panel
it shows me
Your payment information could not be processed. Visit the payment overview page to make sure your payment information is up to date and to pay any outstanding charges.
i am using the same sample application in my home machine there works fine
but i got this error in setting up another machine
Have a look at the documentation 90-day, $300 Free Trial:
The 90-day, $300 Free Trial period starts automatically when you
complete your signup.
To complete your Free Trial signup, you must provide a credit card or
other payment method to set up a Cloud Billing account and verify your
identity.
Also, have a look at the error message:
Your payment information could not be processed. Visit the payment
overview page to make sure your payment information is up to date and
to pay any outstanding charges.
To solve you issue you should update your payment information, as it was suggested by #Shibboleet in the comment section.
Furthermore, 90-day, $300 Free Trial have some limitations that described in Program coverage.

What does it mean "error_subcode": 33 in the facebook response error?

Does anybody know what does it mean error_subcode: 33 in the facebook response error? I know it's related to a mission permission but I want to be 100% sure.
We received the following error:
{"error":{"message":"Unsupported get request. Object with ID 'XXXX'
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":"BRwGjA9kkKU"}}
But in the Facebook API documentation about Graph API https://developers.facebook.com/docs/graph-api/using-graph-api/ , I cannot find error_subcode with value 33.
I want that I can rely on this subcode to verify that I don't have permissions to get the resource from Facebook API because I don't want to rely on the error message.
Here is the Facebook bug portal link to the similar issue:
https://developers.facebook.com/bugs/316526372199563/
The gist of it is:
these users registered for Facebook/Messenger using their phone number and such users are not yet queryable by the API. This is on the roadmap for the API, please keep an eye on our changelog for when this goes live in a future version: https://developers.facebook.com/docs/graph-api/changelog"
I can't offer a definitive solution, as there seem to be multiple possible causes. However, I encountered this today and wish to offer this possible cause.
If you are encountering this error when you are testing your Facebook TEST app, it might be related to the fact that you're in TEST app mode.
In my case, I worked on implementing Facebook login for a while. When my partner joined in development, he couldn't log in in his development environment. He got the error you mention for the 'me' endpoint:
{
"error": {
"message": "Unsupported get request. Object with ID 'me' 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": "____"
}
}
This had actually already been deployed and tested to our production environment, where we are both able to register and log in just fine.
After I added him as Administrator to the Facebook TEST app, the issue resolved and he could register and log in on his own development environment.
So, you may want to check if this is applicable to you. An easy way to check is to use the keys for the real app in your development environment.
Error subcode 33 information as per Facebook official documentation:
Error code 100, subcode 33
Unsupported post request.
This error may occur if your access token is not added as a system user with appropriate permissions to the ad account that owns a Custom Audience. Verify the ad account in Business Manager and verify all system users appear under the ad account as Admin:
Click on Business Settings
Click the ad account
Select Add people
Search for system user and add them as Admins
Retry your API call
Here's the link to the Facebook marketing API error reference.
https://developers.facebook.com/docs/marketing-api/error-reference/
This contains the resolution for error 33 along with all the other errors.

Facebook Reach Estimate - not suficient permissions

I am trying to follow an example on Reach Estimate in facebook API documentation here. However I am getting an error:
{
"error": {
"message": "(#10) You do not have sufficient permissions to perform this action",
"type": "OAuthException",
"code": 10
}
}
My approach is to open https://developers.facebook.com/tools/explorer, generate a token giving all permissions including ads_management.
And perform call:
act_ID/reachestimate?currency=EUR&targeting_spec={'countries':['US']}
Where I obtain ad account ID by going to my ads manager and reading it off URL (or by visiting power editor).
It looks simple, but I have no idea at this point what I am missing, I am also getting the same error while using PHP API.
All ideas are much appreciated. Thank you.
If you are using your own app to generate the access token, you are likely on the Standard or Basic tier of the Marketing API. For these tiers, you need to specify each AdAccount you are going to use.
In the developer too, select your app and go to Apps > Settings > Advanced. Under "Advertising Accounts" click the "Ads API" button on the right hand side, and list all the accounts you want to use.
For more info, see:
https://developers.facebook.com/docs/marketing-api/access#standard_accounts