Ent*_*iff 5 facebook-graph-api instagram-api instagram-graph-api
我在后端拥有长期存在的用户令牌,并成功从 graph-api 端点获取不同的信息。
现在,我尝试定期刷新我这边的这些有效、未过期的令牌,并遵循刷新访问令牌文档,但每次都会收到 400 状态代码的错误:
我的请求:
curl -X GET \
'https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&&access_token={my_token}'
Run Code Online (Sandbox Code Playgroud)
回复:
Sorry, this content isn't available right now
Run Code Online (Sandbox Code Playgroud)
为了确保该令牌有效,通过Access Token Debugger 工具进行了检查,看来我的令牌在接下来的 3 个月内有效。
我发现其他几位工程师也有同样的问题,但无法找到任何解决办法或此问题的原因。
有什么解决办法吗?
我已经找到了我的问题的答案,并且由于我已经在评论中看到一个人,我的答案对他有用,因此将其发布在这里。
为了刷新有效令牌,我们可以使用https://graph.facebook.com/oauth/access_token端点。所以带参数的请求将是这样的:
https://graph.facebook.com/oauth/access_token?
grant_type=fb_exchange_token
&client_id={client-id}
&client_secret={client_secret}
&exchange_token={old_token}
Run Code Online (Sandbox Code Playgroud)
另外,还有一点要注意——如果我没记错的话,即使是旧令牌也会保持有效,直到它的 ttl 过期为止。
| 归档时间: |
|
| 查看次数: |
1739 次 |
| 最近记录: |