使用Graph API资源管理器(https://developers.facebook.com/tools/explorer)当您单击"添加字段"时,如何指定作为对象而不仅仅是字符串值的任何参数?像对象数组之类的东西,比如帖子的actions
字段(https://developers.facebook.com/docs/reference/api/post/)
它是一个json对象。
例如从这个答案
$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);
图形API资源管理器中的actions
字段是
[{"name":"Get Search","link":"http://www.google.com"}]