0

你知道如何回复发送到页面的消息吗?

您可以通过发出HTTP POST to /CONVERSATION_ID/messages带有以下参数的 an 来回复用户的消息。

对话ID看起来像t_id.216477638451347

我正在发送GETaccesstoken,我替换CONVERSATION_IDThread ID,并且我正在发送POST一个名为message

但是它不发布,是否有扩展权限?我只有read_page_inbox

4

1 回答 1

0

对不起,我回复错账号了!!

代码是这样的:

<?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);
?>

它回复:

{"id":"302300649895651_312334605558922"}{"error":{"message":"Unsupported post request.","type":"GraphMethodException","code":100}}

谢谢!

于 2013-03-24T12:54:59.490 回答