facebookfacebook-graph-apijoomla

Bad Request/Method not Implemented Error when Publishing Actions to the Timeline


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.


Solution

  • The problem was that instead of doing a cURL POST, one has to add the querystring parameter method=post to the URL.