OAuthException “(#210) 主题必须是一个页面。”
即使我使用的是页面访问令牌而不是应用程序访问令牌,我仍然收到 OAuthException (#210) subject must be a page.
错误。
我正在使用以下内容:
- 来自 facebook 的最新 JavaScript SDK (//connect.facebook.net/en_US/all .js)
- 使用以下代码调用
/{PAGE_ID}/tabs?app_id={APP_ID}&method=POST&access_token={PAGE_ACCESS_TOKEN}
用户登录后使用 FB.api 方法。
我的应用程序不是 FBML,而是 Canvas / iFrame 应用程序。我做错了什么?
我研究了网络,包括 Stackoverflow 和其他 Facebook 论坛,但仍然没有答案。我的应用程序已启用 OAuth。
另外,如果我将链接复制并粘贴到浏览器中,它就可以正常工作。如果我使用 API 则不会。
I Keep getting OAuthException (#210) Subject must be a page.
error even if I am using the Page Access Token and not the App Access Token.
I am using the following:
- Latest JavaScript SDK from facebook (//connect.facebook.net/en_US/all.js)
- Calling the
/{PAGE_ID}/tabs?app_id={APP_ID}&method=POST&access_token={PAGE_ACCESS_TOKEN}
using the FB.api method once the user is logged in.
My Application is not FBML but a Canvas / iFrame App. What am i doing wrong?
I have researched the web including the Stackoverflow and other facebook forums but still no answer on this. OAuth is Enabled for my Application.
Also, If i copy and paste the link in Browser it works fine. It does not if I do it using the API.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我终于让它工作了。
但是,我没有使用 FB.api 来调用上面的链接,而是使用了 jQuery。
我使用了 jQuery“$.getJson(url)”并且它有效。
它的工作原理如下。
构建链接如下。
“https://graph.facebook.com/{PAGE_ID}/tabs?app_id={APP_ID}&method=POST&access_token={PAGE_ACCESS_TOKEN}&callback=?”
调用 jQuery 方法如下。
“$.getJSON(pageUrl, OnCallBack);”其中“OnCallBack”是回调方法。您可以在回电中执行任何您需要的操作。就我而言,情况如下所示。
I finally got it working.
However, Instead of using the FB.api to call the link above, i used jQuery.
I used jQuery "$.getJson(url)" and it worked.
It works as below.
Construct the link as below.
"https://graph.facebook.com/{PAGE_ID}/tabs?app_id={APP_ID}&method=POST&access_token={PAGE_ACCESS_TOKEN}&callback=?"
Call the jQuery method as below.
"$.getJSON(pageUrl, OnCallBack);" where "OnCallBack" is the call back method. You can do anything that you would need in the call back. In my case it was something like below.
对于再次遇到此错误的任何人:
当我使用 wininet 将 https 请求发布到 https://graph.facebook.com/< 时,我收到了相同的错误消息/a>……
我只是将动词从“POST”更改为“GET”,然后就可以正常工作了:
PS:变量“strVerb”用作windows函数HttpOpenRequest的第二个参数。
To anybody who gets this error again:
I have get the same error message while I use wininet to post a https request to https://graph.facebook.com/......
I just changed the verb from "POST" to "GET" , and then it works well:
PS: variable "strVerb" is used as the 2nd parameter of windows function HttpOpenRequest.