您好,我尝试在Facebook上发布操作时有以下代码。如何使用cURL将操作发布到Facebook
(动作是最喜欢的一张照片。)
我在Facebook上开发一个命名空间设置为我的应用程序... XXXXXX-COM
我已经使用Facebook的调试器查询的网址的对象,一切都很好。
的对象具有OG:类型:XXXXXX-COM:照片
$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似乎要被罚款,但我得到以下错误:...
{"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"}}
请帮助。 ..亲切的问候任何响应者... J
为什么不使用php sdk? https://github.com/facebook/php-sdk – martincarlin87 2012-02-01 16:48:06