Facebook Graph API:无法使用curl获得用户性别

时间:2019-03-08 14:01:37

标签: curl facebook-graph-api command-line facebook-php-sdk

我使用了以下命令:

curl -i -X GET "https://graph.facebook.com/me?fields=gender,email,id,name,likes,birthday&access_token=XXX"

但是我得到的响应没有字段gender

{"email":"XXX\u0040gmail.com","id":"XXX","name":"XXX","likes":{"data":[{...}],"paging":{"cursors":{"before":"XXX","after":"XX"}}},"birthday":"XX\/XX\/XXXX"}

我的APP处于开发状态,并且已启用user_genderuser_birthday权限。我通过使用PHP SDK获得了访问令牌。

    $loginUrl = $helper->getLoginUrl($redirect_url, array(
        'email',
        'user_birthday',
        'gender',
        'user_location',
        'user_likes'
    ));

1 个答案:

答案 0 :(得分:0)

在权限下,放入user_gender