2011-04-15 80 views
3

我在Facebook應用程序開發新,我想在事件牆上自動發佈帖子。我已閱讀,包括在特定牆上發佈的ID。我已經嘗試過,但它不起作用。如何發佈在facebook事件牆上?

我想,也許它會用「到」(具體的有針對性的牆)工作,但我不知道它的語法......

誰能幫助?或者至少給一個帖子語法的例子有 「到」 財產包括... ... plssss

+0

你必須先以做 「自動」 的帖子,要求從用戶的權限。 – 2011-04-15 10:19:39

回答

3
$attachment = array(
       'message' => 'this is my message', 
       'name' => 'This is my demo Facebook application!', 
       'caption' => "Caption of the Post", 
       'link' => 'http://mylink.com', 
       'description' => 'this is a description', 
       'picture' => 'http://mysite.com/pic.gif', 
       'actions' => array(array('name' => 'Get Search', 
       'link' => 'http://www.google.com')) 
       ); 
$uid = ""; //friend id OR "me" 
$result = $facebook->api('/'.$uid.'/feed/','post',$attachment); 


注意:你應該有用戶publish_stream extended permission你應該加載SDK Lib

+0

我不確定這實際上回答了提出的問題。如果我錯了,請糾正我,但我相信上面的代碼實際上會發布到用戶的新聞Feed ..而不是事件的牆。我也相當肯定,簡單地用事件的ID替換上面代碼中的用戶ID也是行不通的。 – Kai 2011-04-16 07:03:39

+0

@kai:方法「feed」在給定配置文件的feed/wall上發佈一個新帖子,剩下的工作只是讀取API DOC並跟隨兔子。希望這個幫助! ;)http://developers.facebook.com/docs/reference/api/ – 2011-04-16 10:04:31

+0

非常感謝你的幫助!我很感激你的時間...^_^ – kim 2011-04-19 04:37:21

0
$attachment = array(
       'message' => 'this is my message' 
       ); 
$eid = ""; //event id 
$result = $facebook->api('/'.$eid.'/feed/','post',$attachment); 

http://developers.facebook.com/docs/reference/api/event/ < - 事件對象文檔

https://api.facebook.com/method/stream.publish?message=<your_message>&target_id=<event_id>&access_token=<your_token> 
+0

https://developers.facebook.com/docs/graph-api/reference/事件/飼料#發佈 – netalex 2016-02-17 10:17:14