{
"error": {
"message": "(#15) This method must be called with an app access_token.",
"type": "OAuthException",
"code": 15,
"fbtrace_id": "AaKKgfwJzZsNDXADht1N7wy"
}
}
https://graph.facebook.com/v19.0/{app-id}/accounts?access_token={long-lived-user-access-token}
https://graph.facebook.com/v19.0/oauth/access_token?grant_type=fb_exchange_token&client_id={app-id}&client_secret={app-secret}&fb_exchange_token={short-lived-user-access-token}
- This is the endpoint for the API call to receive a long-lived page access token:
https://graph.facebook.com/v19.0/{app-id}/accounts?access_token={long-lived-user-access-token}
No, it's not. Accounts belong to the user object, not the application. {app-id}
needs to actually be the app-scoped user id - or just me
, since a user token is used for the request anyway.
(The error message saying that it needed an app access token, is simply due to the fact that you targeted the wrong endpoint in the first place.)