2012-01-08 15 views
1

使用圖形API資源管理器(https://developers.facebook.com/tools/explorer)如何在單擊「添加字段」時指定任何屬於對象的參數,而不僅僅是字符串值?的東西等的物體,如後(https://developers.facebook.com/docs/reference/api/post/)使用Graph API Explorer工具,如何在HTTP Post中指定複雜參數?

+0

?你能提供任何示例或任何特定的GRAPH呼叫嗎? – Vijay 2012-01-09 04:54:22

+0

'\ me \ feed'就是一個例子,但是Alex Blex下面完美地回答了我的問題......雖然他們也不需要那裏的PHP例子,但沒關係。 – DMCS 2012-01-09 14:20:51

回答

2

actions領域中,JSON對象的陣列。

例如從this answer

$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')) 
       ); 
    $result = $facebook->api('/me/feed/', 
           'post', 
           $attachment); 

actionsGraph API Explorer

[{"name":"Get Search","link":"http:\/\/www.google.com"}]

在這情況下,你要通過郵局發送對象
+0

甜的JSON格式工作!謝謝。 – DMCS 2012-01-09 14:14:38

+0

也有任何方式的圖像也(源字段不是網址)? – 2015-01-15 05:08:56

相關問題