facebook-graph-api 获取“无效的 OAuth 访问令牌。” 3次https调用后

发布于 2024-10-14 19:51:06 字数 965 浏览 2 评论 0原文

你好,我正在尝试获取群组墙提要,我使用桌面应用程序来获取所有提要,但在 3 个 https api 调用之后,我得到:

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

这是我的调用:

https://graph.facebook.com/175923872448029/feed?access_token=355xxxx|2575b794cd858xxxx-55xxx13|N-oGZ6q2sNDNgxxxxU-TDw&distance=100000&limit=30&offset=0

https://graph.facebook.com/175923872448029/feed?access_token=355xxxx|2575b794cd858xxxx-55xxx13|N-oGZ6q2sNDNgxxxxU-TDw&distance=100000&limit=60&offset=30

https://graph.facebook.com/175923872448029/feed?access_token=355xxxx|2575b794cd858xxxx-55xxx13|N-oGZ6q2sNDNgxxxxU-TDw&distance=100000&limit=90&offset=60

https://graph.facebook.com/175923872448029/feed?access_token=355xxxx|2575b794cd858xxxx-55xxx13|N-oGZ6q2sNDNgxxxxU-TDw&distance=100000&limit=120&offset=90 <-- this call gives me the error

奇怪的是,当我接受此 https 调用时,调用失败并运行它火狐,它确实返回我结果有什么想法吗?

Hi im trying to get group wall feeds , im using desktop application to get all the feeds but after 3 https api calls im getting :

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

this are my calls:

https://graph.facebook.com/175923872448029/feed?access_token=355xxxx|2575b794cd858xxxx-55xxx13|N-oGZ6q2sNDNgxxxxU-TDw&distance=100000&limit=30&offset=0

https://graph.facebook.com/175923872448029/feed?access_token=355xxxx|2575b794cd858xxxx-55xxx13|N-oGZ6q2sNDNgxxxxU-TDw&distance=100000&limit=60&offset=30

https://graph.facebook.com/175923872448029/feed?access_token=355xxxx|2575b794cd858xxxx-55xxx13|N-oGZ6q2sNDNgxxxxU-TDw&distance=100000&limit=90&offset=60

https://graph.facebook.com/175923872448029/feed?access_token=355xxxx|2575b794cd858xxxx-55xxx13|N-oGZ6q2sNDNgxxxxU-TDw&distance=100000&limit=120&offset=90 <-- this call gives me the error

the weird thing is that when im take this https call the one failed and run it in firefox , it does return me result any idea way ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

客…行舟 2024-10-21 19:51:06

您没有设置正确的身份验证。请参阅:http://developers.facebook.com/docs/authentication/

You do not have proper authentication set. See: http://developers.facebook.com/docs/authentication/

病女 2024-10-21 19:51:06

对于我的情况,我实际上是这样做的:

我尝试了多种方法,并且也收到了无效的 OAuth 访问令牌错误。
使用 Graph Explorer 获取页面访问令牌后,我编写了以下代码:

pagetoken = 'EAAOSZBmdTKBMBAIf1FrTGmapagVZAvwdlrwSWNc3EZCOTXQ90Im9u'

mylikes = "https://graph.facebook.com/me?fields=likes.summary(true)&access_token"+pagetoken 

然后我注意到缺少等号,这修复了无效的 OAuth 访问令牌错误。

pagetoken = 'EAAOSZBmdTKBMBAIf1FrTGmapagVZAvwdlrwSWNc3EZCOTXQ90Im9u'

mylikes = "https://graph.facebook.com/me?fields=likes.summary(true)&access_token="+pagetoken 

我希望它可以帮助任何遇到同样问题的人。

For my case, I actually did it this way:

I have tried several ways, and I got the invalid OAuth access token error too.
After getting my page access token using the Graph Explorer, I wrote this code:

pagetoken = 'EAAOSZBmdTKBMBAIf1FrTGmapagVZAvwdlrwSWNc3EZCOTXQ90Im9u'

mylikes = "https://graph.facebook.com/me?fields=likes.summary(true)&access_token"+pagetoken 

I then noticed an equal sign was missing, and that fixed my invalid OAuth access token error.

pagetoken = 'EAAOSZBmdTKBMBAIf1FrTGmapagVZAvwdlrwSWNc3EZCOTXQ90Im9u'

mylikes = "https://graph.facebook.com/me?fields=likes.summary(true)&access_token="+pagetoken 

I hope it helps anyone with the same issue.

停顿的约定 2024-10-21 19:51:06

这种情况在我身上发生了几个小时:

facebook-graph-api 获取“无效的 OAuth 访问令牌”。

就我而言,应用程序重定向到本地地址,并且 Facebook 授权的 URL 不是本地地址,因此 Facebook 无法让我登录。

我使用的用户的 access_token 是脚本中保存的一些旧 access_token window.sessionStorage。所以我以为我使用了正确的 access_token,但事实并非如此。

That happened to me for hours:

facebook-graph-api Getting “Invalid OAuth access token.”

In my case, the application was re-directing to a local address, and the URL authorized by Facebook was not local, so Facebook was not login me in.

The access_token for the user I was using was some old access_token kept in the script by window.sessionStorage. So I thought I was using the right access_token, but I was not.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文