gpt4 book ai didi

oauth - 获取无效的 oauth 访问 token : where is the token I need?

转载 作者:行者123 更新时间:2023-12-03 23:25:28 24 4
gpt4 key购买 nike

我需要帮助获取/定位 API 调用的正确 access_token 值。

我正在配置一个应用程序,该应用程序希望使用位于 https://graph.facebook.com/fql 的 graph-api 搜索请求来搜索 Facebook。 ,为此我需要一个 access_token。该应用程序是后端服务器,因此没有 UI 和用户。

我使用开发者页面的“创建新应用程序”链接注册了一个新的“应用程序”,所以我现在有一个应用程序:https://developers.facebook.com/apps/ <> 并从中我得到一个“应用程序 secret ” token 。深入研究应用程序的高级设置页面,还有一个客户端 token 。

但是,使用任一 token 都会导致以下 JSON 错误:

{"error":{"message":"Invalid OAuth access token.","type":"OAuthException","code":190}}



谁能指出我哪里出错了?

==

下面的“curl”请求演示了命令正常工作,但它只是偶尔像这样无 token 可用,所以应用程序需要 &access_token=...stuff... 添加到参数中。

$ curl 'https://graph.facebook.com/fql?q=select%20url,%20share_count,%20like_count,%20comment_count,%20click_count,%20total_count%20from%20link_stat%20where%20url%20=%20"http%253A%252F%252Felifesciences.org%252Fcontent%252F2%252Fe01233"'

{"data":[{"url":"http\u00253A\u00252F\u00252Felifesciences.org\u00252Fcontent\u00252F2\u00252Fe01233","share_count":0,"like_count":0,"comment_count":0,"click_count":0,"total_count":0}]}

最佳答案

“应用程序 secret ”和“客户端 token ”将不起作用。
您需要的是一个Access Token,引用this .

关于oauth - 获取无效的 oauth 访问 token : where is the token I need?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23524334/

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