1
votes

Hello I have the following code in an attempt to publish an action on facebook.

(The action is to favourite a photo.)

I have set in the facebook dev a namespace for my app... xxxxxx-com

I have used the facebook debugger to check the url of the object and all is ok.

The object has an og:type: xxxxxx-com:photo

$url = 'https://graph.facebook.com/'.$userFacebookId.'/xxxxxx-com:favourite';     
$ch = curl_init();   
$attachment = array('access_token' => $accessToken,
'photo' => $urlOfObject,
);      
curl_setopt($ch, CURLOPT_URL,$url);     
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);     
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);     
curl_setopt($ch, CURLOPT_POST, true);     
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);     
$result= curl_exec($ch);
curl_close ($ch); 

Everyhting seems to be fine, however I get the following error:...

{"error":{"message":"(#3502) Object at URL urlOfObject has og:type of 'xxxxx-com:photo'. The property 'photo' requires an object of og:type ''.","type":"OAuthException"}}

PLease help... kind regards to any responders... J

1
why don't you use the php sdk? github.com/facebook/php-sdk - martincarlin87

1 Answers

0
votes

It would appear the the object type of 'photo' is what is causing the problem. If I change the object type throughout the code and dev to for example 'myphoto' then it works fine. Anyone know why?

I thought the whole point of the app's namespace was to permit the use of any object types. However I have also noticed that you can not have an object type image?

Anyway thanks for looking.