Unable to fetch email from created facebook test users

1k Views Asked by At

I have created a facebook test user using Graph API with following query parameters.

https://graph.facebook.com/<app-id>/accounts/test-users

installed = true                                  
method = post                                     
name = Test Account YNRSVOZHXO             
permission = email,public_profile                                
locale = en_US   
access_token = <app-id>|<client-secret>                                

which is giving response having id, email, access_token of the created user.

When i call the following API, I am not getting email.

https://graph.facebook.com/me?access_token=<access-token>&fields=id,name,email

Permissions of the test-user,

https://graph.facebook.com/<test-user-id>/permissions?access_token=<access-token>

returning

 {
   "data": [
    {
        "permission": "user_friends",
        "status": "granted"
    },
    {
        "permission": "public_profile",
        "status": "granted"
    }
  ]
}

In the dashboard, I can see the test user's email.

How do I grant email permission also, when creating test user or may be refresh access token using Graph API.

1

There are 1 best solutions below

0
Sarath On

Instead of query parameter permission, I used permissions and its working now.