We have a production Meta Application and currently we use the Facebook Login for Business which generates a code that we exchange for a System User Access Token on our microservice. On production we can then use this System User Access Token to make a request to /me/accounts which returns the list of pages that we can access, along with an access token, see below:
{
"data": [
{
"access_token": "",
"id": "",
"tasks": [
"ADVERTISE",
"ANALYZE",
"CREATE_CONTENT",
"MESSAGING",
"MODERATE",
"MANAGE"
]
}
]
}
In production we are then able to take the PAGE_ACCESS_TOKEN from this response and make a request to {page-id}/ads_posts to get the Page Ad Posts for that particular page and all works fine and we get a response as we expect.
However, we also have test applications for our Development and Staging environments. When I perform the same actions, that being: 1. Get System User Access Token by Exchanging Code from Test App Facebook Login For Business 2. Use System User Access Token to make request to /me/accounts 3. Make request to {page-id}/ads_posts using the page access token.
I don't get a proper response from the API, instead I get:
{
"error": {
"message": "Cannot call API for app on behalf of user ",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "AGld_EhayIp285qarsuYVAC"
}
}