2012-01-10 45 views
4

我使用這個代碼:如何使用Facebook SDK API「喜歡」網頁/網址?

$facebook->api('/me/likes/', 'post', array('url' => 'http://www.google.com')); 

我得到以下錯誤:

Fatal error: Uncaught OAuthException: (#200) App does not have permission to make this call thrown in 

範圍(權限)是:

'scope' => 'publish_stream, email' 
+1

請停止在標題中寫標籤。 – 2012-01-10 12:45:38

回答

4

,可以通過編程的唯一的事喜歡是facebook與likes連接的對象。

https://developers.facebook.com/docs/reference/api/摘自:

You can comment on or like any object that has a /comments or /likes connection by posting to https://graph.facebook.com/OBJECT_ID/comments and https://graph.facebook.com/OBJECT_ID/likes


UPDATE:

user對象還具有喜歡連接,但是,其用於喜歡其他對象的聚集,它不可能「喜歡」用戶。 (謝天謝地; P)

感謝@Juicy的編劇指出這一點...

+1

有一個例外,'user'對象。 ;)由於其他原因,有其他原因的這種聯繫,喜歡其他對象聚集 – 2012-01-10 16:20:27

+0

非常真實的Mr.Juicy :)謝謝你的... – Lix 2012-01-10 16:42:05