Search code examples
facebookfacebook-graph-apifacebook-loginfacebook-permissions

Why does the Facebook Graph API show some permissions declined when they were all granted and the UI accurately reflects this?


I have authorized my app for several Facebook permissions using my own user account. If I look at the UI, I can see those permissions granted.

Permissions granted in FB UI

If I pull the permissions from the API, it shows many of these same permissions as declined for my user.

FB API permissions response

That's an API call through the Graph API Explorer using my app's token. I get the same results using cURL.

Some of these permissions require approval from FB, but they have all been approved.

Permissions approved for the app by FB

It feels like I'm missing something here. Why does the API return different results than what is shown in the UI? I'm hoping to use the API to see which permissions a user has granted for my app and to ask for a new one if they haven't already granted it. If I can't get accurate results from the API, this won't work.


Solution

  • This happened because I had the wrong Facebook user ID. I used a web site to find my ID which gave me the wrong ID. I found my ID in my app's database, and this returned the correct results from the API.