Facebook 页面 (/me/accounts) access_token 过期?
请耐心等待,我知道 access_token
问题已被问过一千次,但我似乎找不到这个特定问题的答案。
Facebook 页面(不是应用程序,不是用户)访问令牌是否有过期日期?
我知道:
offline_access
已被弃用。- 我可以请求 60 天的用户
access_token
第 1 步: 我使用 Facebook Connect,并获得一个用户 access_token
具有 manage_pages
权限(默认情况下,此令牌会在 2 小时内过期,可延长至 60 天)
第 2 步: 然后我调用 /me/accounts 和获取一组用户页面,每个页面都有一个列出的页面
access_token
第3步:我可以使用页面 access_token
在后续 API 调用中执行诸如发布到用户页面之类的操作。
我需要用户能够安排将来发生的页面更新(当他们不在线时)。
那么问题又来了:
- 从
/me/accounts
返回的 pageaccess_token
的过期日期是多少?
如果过期日期与某些内容相关,那么它与什么相关?
- 请求
/me 时使用的用户
access_token
的过期日期/帐户? - 自向
/me/accounts
发出请求后 60 天?
对于我的困惑,我深表歉意,Facebook 文档似乎在描述这些访问令牌方面极其缺乏。
Bear with me, I know access_token
questions have been asked a thousand times but I can't seem to find an answer to this specific question.
Is there an expiration date for Facebook Page (not app, not user) access tokens?
I know that:
offline_access
has been deprecated.- I can request a 60-day user
access_token
Step 1: I use Facebook Connect and I get a user access_token
which has the manage_pages
permission (by default, this token expires in 2 hours, extendable to 60 days)
Step 2: I then call /me/accounts
and get an array of the user's pages each one with a listed page access_token
Step 3: I can use the page access_token
in subsequent API calls to do things like posting to the user's page.
I need users to be able to schedule page updates to happen in the future (when they will not be online).
So again the question is:
- What is the expiration date of the page
access_token
returned from/me/accounts
?
If the expiration date is tied to something, what is it tied to?
- Expiration date of the user
access_token
used when requesting/me/accounts
? - 60-days from when the request is made to
/me/accounts
?
I apologize for my confusion, the Facebook documentation seems to fall extremely short in describing these access tokens.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚创建了一个全新的应用程序。确保启用了弃用的离线访问。转到资源管理器,在下拉列表中找到我的新应用程序,授予自己管理页面,转到我/帐户抓取页面访问令牌之一,然后检查它。哇! 1小时到期。
编辑
我尝试交换 1 小时页面令牌,但从 Facebook 收到错误。
我回到用户访问令牌,并将其换成 60 天的令牌。在 linter 中验证这是 60 天。回到我/帐户并获取其中一个页面访问令牌并对其进行检查。惊喜!从那里获得了 60 天的令牌。
所以这个故事的寓意是,你不能交换页面令牌,只能交换用户令牌。但使用 60 天的用户令牌,您可以获得 60 天的页面令牌。 :)
I just created a brand new app. Ensured the deprecate offline access was enabled. Went to explorer, found my new app in the dropdown, granted myself manage_pages, went to me/accounts grabbed one of the page access tokens, and then linted it. Whew! 1 hour expiration.
EDIT
I tried exchanging that 1 hour page token and I got an error from fb.
I went back to the user access token, and exchanged it for a 60 day one. Verified in the linter that it was a 60 day. Went back to me/accounts and grabbed one of the page access tokens and linted it. Suprise! Got a 60 day token from there.
So the moral of the story is, you cannot exchange page tokens, only user tokens. But with a 60 day user token you can get a 60 day page token. :)