回复发送到页面的消息
问题描述:
你知道如何回复发送到页面的消息吗?回复发送到页面的消息
您可以通过发出带有以下参数的HTTP POST to /CONVERSATION_ID/messages
来回复用户的消息。
的对话ID
看起来像t_id.216477638451347
我GET
正在发送的accessToken,我换成CONVERSATION_ID
与Thread ID
,我在发送一个POST
变种称为message
但它不到风度帖子,有扩展权限吗?我只有read_page_inbox
答
对不起,我回复了错误的帐户!
的代码是这样的:
<?php
include("config.php");
post("Test",$at);
$id = "550773858289457";
$url = "https://graph.facebook.com/$id/messages?access_token=$at";
$ch = curl_init();
$attachment = array('message' => 'description here'
);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
$result= curl_exec($ch);
curl_close ($ch);
?>
它replyes:
{"id":"302300649895651_312334605558922"}{"error":{"message":"Unsupported post request.","type":"GraphMethodException","code":100}}
三江源!
+0
你解决了这个问题吗? – clopez 2014-02-21 19:57:25
请张贴您的php代码 – chriz 2013-03-22 11:55:36
您是否使用页面访问令牌? – CBroe 2013-03-22 13:14:52
我有同样的问题,消息被创建,我可以得到的uuid返回时,当我提交它,但是当我使用uuid来查找msg的“消息”字段是空的,就像我的消息已经剥离出来它。即使将应用程序设置为我的应用程序,我也可以成功地从Graph API进行回复,但我无法直接从应用程序获取此应用程序。 – 2016-03-07 12:36:42