使用Graph API Explorer工具,如何在HTTP Post中指定复杂参数?

时间:2012-01-08 21:08:15

标签: facebook facebook-graph-api

使用Graph API Explorer(https://developers.facebook.com/tools/explorer)如何在单击&#34时指定任何对象参数而不仅仅是字符串值;添加字段&#34 ;?诸如帖子的actions字段之类的对象数组(https://developers.facebook.com/docs/reference/api/post/)

1 个答案:

答案 0 :(得分:2)

它是一个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);

Graph API Explorer中的actions字段

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