I am using the PHP SDK to post to the logged in users timeline using the facebook::api method. I am pretty sure I had it working in the past but now it seems to fail and return the following error:
OAuthException: (#3502) Object at URL http://example.com/ has og:type of 'website'. The property 'event' requires an object of og:type 'example:event'.
I have placed the URL into the Facebook debugger tool adn this returns fine. I have also used the Graph API explorer to test the POST request as well and this works. The only place it doesnt is from my PHP script.
I know I am not the only one who is experiencing this but it seems that everyone else is using the Javascript SDK so the solution is not relevant to me.
I have also tried setting scrape=true
in my request but this makes no difference.
The code I am using is:
try{
// Post the reply to the Facebook users wall
$this->facebook_get_attendance['action_id'] = $this->facebook->api(
"/me/example:reply?event=".urlencode("http://www.example.com/facebook-event/$this->area_rel/$this->facebook_event_reply_id")."&scrape=true&access_token={$this->facebook_user_details['access_token']}",
"POST"
);
$this->facebook_get_attendance['action_id'] = $this->facebook_get_attendance['action_id']['id'];
}catch(FacebookApiException $e){
error_log($e);
$this->facebook_get_attendance['action_id'] = NULL;
}
Any ideas why this is happening?
The URL that is being passed is:
/me/example:reply?event=http%3A%2F%2Fwww.example.com%2Ffacebook-event%2Fbath%2F612&access_token=ACCESS_TOKEN