gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 12:39:56 25 4
gpt4 key购买 nike

我想使用图谱 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);
?>
---------

在文档message_tags字段中,

---------
object containing fields whose names are the indexes to where objects are
mentioned in the message field; each field in turn is an array containing
an object with id, name, offset, and length fields, where length is the
length, within the message field, of the object mentioned
---------

https://developers.facebook.com/docs/reference/api/post/

允许的范围是 read_stream 和 publish_stream。

最佳答案

显然,message_tags 只能通过 API 读取。不支持编写 message_tags。请参阅 2011 年 11 月 22 日的 bug report and facebook response

关于php - 如何在 PHP 中使用 Graph API 使用 message_tags 字段发布消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8351194/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com