将操作发布到时间轴时出现错误请求/方法未实现错误
我正在开发一个 Joomla 网站,并使用 myApi 来处理大多数 Facebook 集成。 Like 按钮工作正常,并从 myApi 插入的 og 元标签中获取信息。
在网站上,用户可以使用 facebook 登录 - 我已在 myApi 代码中添加了publish_actions 权限,并且我知道这是被请求的,因为在授权应用程序时,oauth 对话框显示从餐厅订购之类的操作(我添加的操作)到我的 Facebook 应用程序)将发布到时间线。
现在,在订购时,我会检查用户在 myApi 用户表中是否有条目,如果有,我会提供一个复选框,让客户选择是否要将订单操作发布到她的时间线。如果勾选,我会使用curl 尝试将订单操作发布到facebook。我一直在使用我的帐户进行测试 - 我已向该应用程序授权了所请求的所有权限。我使用 myApi 接口来获取我的用户访问令牌。我将 access_token 和对象 url 添加到 url 作为查询字符串参数,然后通过curl 发布到它。
我得到的卷曲响应是:
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY>
<H1>Method Not Implemented</H1>
Invalid method in request<P>
</BODY></HTML>
在浏览器中访问生成的 url 时得到的响应是
{
"data": [
],
"paging":{
"next": "https://graph.facebook.com/me/og_collegekhana:order_from?restaurant=http\u00253A\u00252F\u00252Fwww.collegekhana.com\u00252Fstates\u00252Ftamil-nadu\u00252Fcampus-1\u00252Feat-1&access_token=[the token I got]&offset=25&limit=25"
}
}
检查了 url 的对象 id
我使用https://graph.facebook.com/?ids=http://www.collegekhana.com/states/tamil-nadu/campus-1/eat-1
我没有得到一个对象 ID。相反,我发现
{
"http://www.collegekhana.com/states/tamil-nadu/campus-1/eat-1": {
"id": "http://www.collegekhana.com/states/tamil-nadu/campus-1/eat-1"
}
}
我完全迷失了,希望有人能告诉我我做错了什么。
I am working on a Joomla site and using myApi to handle most facebook integrations. The like button is working fine and picking up information from the og meta tags inserted by myApi.
On the website, the user can login using facebook - I have added the publish_actions permission to the myApi code, and I know this is being requested because when authorising the app, the oauth dialog says that actions like ordering from restaurants (the action i added to my fb app) will be posted to the timeline.
now, while ordering, I check whether the user has an entry in the myApi user table and if so, I provide a checkbox that lets the customer choose whether she wants the order action posted to her timeline. if ticked, I then use curl to try and post the order action to facebook. I have been using my account to test - I have authorised the app with all permissions requested. I use the myApi interface to get my user access token. I am adding the access_token and object url to the url as querystring parameters and then posting to it through curl.
The curl response I get is:
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY>
<H1>Method Not Implemented</H1>
Invalid method in request<P>
</BODY></HTML>
the response I get when going to the generated url in my browser is
{
"data": [
],
"paging":{
"next": "https://graph.facebook.com/me/og_collegekhana:order_from?restaurant=http\u00253A\u00252F\u00252Fwww.collegekhana.com\u00252Fstates\u00252Ftamil-nadu\u00252Fcampus-1\u00252Feat-1&access_token=[the token I got]&offset=25&limit=25"
}
}
I checked the object id of the url using
https://graph.facebook.com/?ids=http://www.collegekhana.com/states/tamil-nadu/campus-1/eat-1
I am not getting an object id. instead I get
{
"http://www.collegekhana.com/states/tamil-nadu/campus-1/eat-1": {
"id": "http://www.collegekhana.com/states/tamil-nadu/campus-1/eat-1"
}
}
I am completely lost and hope someone can tell me what I am doing wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是,必须添加查询字符串参数,而不是执行 cURL POST
方法=发布到 URL。
The problem was that instead of doing a cURL POST, one has to add the querystring parameter
method=post to the URL.