Search code examples
facebook-graph-apifacebook-access-token

Facebook Graph API - Access token from code - Service temporarily unavailable


I'm trying to fetch a user access token by code with the FB Graph API.

This is the API request that im sending:

https://graph.facebook.com/v17.0/oauth/access_token?client_id={APP_ID}&client_secret={APP_SECRET}&redirect_uri={REDIRECT_URI}&code={CODE}

I get the {CODE} by sending the user to: https://www.facebook.com/v17.0/dialog/oauth, from which i get the code no problem. The issue is that I keep getting this same response, no matter what.

"error" => [
    "message" => "(#2) Service temporarily unavailable",
    "type" => "OAuthException",
    "is_transient" => 1,
    "code" => 2,
    "fbtrace_id" => {SOME_CODE},
]

I tried waiting some time in between the API calls, but nothing changed.

Also tried changing the redirect_uri parameter (tried setting it the same as the redirect_uri sent with the v17.0/dialog/oauth URL), didn't help.

Also changed the APP mode from Testing to Live, didn't help.


Solution

  • PEBKAC, there was a typo in the request URL sent to the API.