gpt4 book ai didi

facebook-graph-api - 通过 Instagram 图形 api 刷新长期 token

转载 作者:行者123 更新时间:2023-12-04 13:51:52 25 4
gpt4 key购买 nike

我在后端拥有长期存在的用户 token ,并成功从图形 API 端点获取不同的信息。
现在我正在尝试定期刷新这些有效的、未过期的 token ,并关注 Refresh Access Token文档,但每次都会收到 400 状态代码的错误:
我的请求:

curl -X GET \
'https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&&access_token={my_token}'
回复:
Sorry, this content isn't available right now
为了确保 token 有效,请通过 Access Token Debugger tool 检查它我的 token 似乎在接下来的 3 个月内有效。
我发现其他几位工程师也有同样的问题,但找不到任何出路或此问题的原因。
有什么解决办法吗?

最佳答案

我已经找到了我的问题的答案,因为我已经在评论中看到一个人,我的回答对他有用,所以我将其发布在这里。
为了刷新有效 token ,我们可以使用 https://graph.facebook.com/oauth/access_token端点。
所以带有 params 的请求将是这样的:

https://graph.facebook.com/oauth/access_token?
grant_type=fb_exchange_token
&client_id={client-id}
&client_secret={client_secret}
&exchange_token={old_token}
另外,还有一点要注意——如果我没记错的话,即使是旧 token 也会一直有效,直到它的 ttl 没有过期。

关于facebook-graph-api - 通过 Instagram 图形 api 刷新长期 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68608652/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com