Can't access friends's informations with the graph API

二次信任 提交于 2020-01-02 05:19:20

问题


I'd like to retrieve, for instance, a friend's birthday, using the graph API.

So I pick a friend whose birthday my profile can see, go to the Graph API Explorer, generate an access token with the friends_birthday privilege, and input [friend_name]/?fields=birthday and... it doesn't return anything. The birthday field on the side is grayed out, with a mouse-over text that says

"Field is empty or disallowed by the access token".

The worst part is that it works fine for some friends, but not for others. Is it related to the level of visibility they set for this information on their profile? I assumed that the app can see everything my profile can see (if I give it full privileges), but maybe that's not the case. Or is there something wrong with my request?


回答1:


I had the same problem and the answer is that your friend can change the permissions it gives to apps. So, for the Graph API Explorer app your friend would need to give the user_birthday permission to the app in order for you to see their birthday through the app (and you have to give the app the friends_birthday permission as well).

See here for the comment that helped me figure that out.



来源:https://stackoverflow.com/questions/15764326/cant-access-friendss-informations-with-the-graph-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!