小编Tor*_*ura的帖子

如何使用PHP中的Graph API在message_tags字段中发布消息

我想使用Graph API使用message_tags发布消息.

我确认消息只发布在PHP中,但不能与message_tags一起使用..

这是示例代码.

---------
<?php
require_once('facebook.php');

$facebook = new Facebook(array(
  'appId'  => '127916833975***', // masked
  'secret' => 'a3271136ad68587d8e83171148f93***' // masked
));

$request_params = array('message' => mb_convert_encoding('test posting message', 'UTF-8', 'EUC-JP'));

$tags = array(
          'id' => '100000834278***', // masked
          'name' => 'MY_FRIENDS_NAME', // masked
          'offset' => 0,
          'length' => 15 // friend name length
        );

$request_params['message_tags'] = $tags;
$facebook->api('/feed', 'POST', $request_params);
?>
---------
Run Code Online (Sandbox Code Playgroud)

在文档message_tags字段中,

---------
object containing fields whose names are the indexes to where objects are 
mentioned in the …
Run Code Online (Sandbox Code Playgroud)

php post facebook-graph-api

8
推荐指数
1
解决办法
5265
查看次数

标签 统计

facebook-graph-api ×1

php ×1

post ×1