在Facebook Graph API中,获取用户电子邮件地址的API调用是什么?

问题描述:

在这里,我只是通过其他客户端发送GET请求。它只返回用户ID和名称。此外,如何仅使用GET请求检索用户的电子邮件?

Here I'm simply sending a GET request through a rest client.It returns only user id and name .Additionally, how do I retrieve user's email using only a GET request?

https://graph.facebook.com/me?access_token= [用户访问令牌]

https://graph.facebook.com/me?access_token= [User's access token]

https://graph.facebook.com/me?fields=name,email&access_token=[User's access token]

它被称为声明字段和附带Graph API的v2.4版本: https://developers.facebook.com/docs / apps / changelog#v2_4

It´s called "Declarative Fields" and came with v2.4 of the Graph API: https://developers.facebook.com/docs/apps/changelog#v2_4

API Explorer测试: https://developers.facebook.com/tools/explorer/?method=GET&path=me%3Ffields%3Dname%2Cemail

API Explorer test: https://developers.facebook.com/tools/explorer/?method=GET&path=me%3Ffields%3Dname%2Cemail

当然,您需要使用包含电子邮件权限/范围的用户令牌。在此处调试您的令牌: https://developers.facebook.com/tools/debug/accesstoken/

Of course you need to use a User Token that includes the email permission/scope. Debug your Token here: https://developers.facebook.com/tools/debug/accesstoken/