1

Python APIを使用してFacebookで友達の誕生日を取得したかっただけです

https://developers.facebook.com/tools/explorer/で「me/friends?fields=birthday」というクエリを試してみましたが、うまくいきましたが、私の Python コードでは「GraphAPIError: An active access token must be現在のユーザーに関する情報を照会するために使用されます。」

ここにコードを投稿しました:

import facebook

token = 'a token' # token omitted here, this is the same token when I use in https://developers.facebook.com/tools/explorer/ 

graph = facebook.GraphAPI(token)
fb = graph.request("me/friends?fields=birthday")
# while graph.request("me/friends") works well


print fb

誰かが助けますか?

4

3 に答える 3

1

私はそれを少し微調整しましたが、これは部分的に機能します。

from facepy import GraphAPI
graph=GraphAPI('AccessToken')
friends=[]
friends= graph.get("me/friends?fields=birthday") 
print friends

ただし、一部の誕生日のみが返されます (600 人以上の友人のうち 3 人だけが返されました)。

于 2014-05-14T19:13:16.850 に答える
0

そこにIDを提供する必要があります。同じ質問があります。探しているもの: (OAuthException - #2500) 現在のユーザーに関する情報を照会するには、アクティブなアクセス トークンを使用する必要があります

于 2013-11-04T03:20:06.850 に答える