万岁访问令牌,API如何?

2024-06-25 23:15:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用python为Facebook获取一个long-live访问令牌。你知道吗

这是我找到的代码:

from facepy.utils import get_extended_access_token

app_id = 'xxx'
app_secret = 'yyy'

short_lived_access_token = "Token"

LONG_LIVE_ACCESS_TOKEN, expires_at = get_extended_access_token(
          short_lived_access_token,
          app_id, app_secret)

f = open("f.txt","w")
f.write(LONG_LIVE_ACCESS_TOKEN)
print expires_at

主要问题是,如果我把它生成的代码放在我的程序中,会出现以下错误:

facepy.exceptions.FacebookError: [100] API calls from the server require an appsecret_proof argument

据我所知,这意味着我用错了令牌。 如何解决这个问题?你知道吗


Tags: 代码fromtokenidliveappextendedget