GraphAPIError:验证访问令牌时出错:会话与当前存储的会话不匹配。这可能是因为用户更改了密码

时间:2016-12-12 14:26:36

标签: facebook-graph-api mobile

如果我在手机上使用图形API来检索用户事件,我会收到错误消息:

GraphAPIError: Error validating access token: Session does not match current stored session. This may be because the user changed the password since the time the session was created or Facebook has changed the session for security reasons.

但是,如果我不久后第二次再试一次,那就行了。如果我等待太久(几个小时),这个问题就会重新出现。

我的Python代码是:

graph = facebook.GraphAPI(access_token=TOKENS["user_token"])

time.sleep(0.6) # to deal with Graph API latency, although problem is visibly not here

event = graph.get_object(id=event_id, fields='attending_count,declined_count,interested_count,is_viewer_admin,is_page_owned, owner,name')

一切都适用于台式电脑。

0 个答案:

没有答案