回复发送到页面的消息

时间:2013-03-22 11:41:37

标签: php facebook facebook-graph-api open-graph-protocol

您知道如何回复发送到网页的邮件吗?

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

对话ID看起来像t_id.216477638451347

我发送了GET来访问的内容,我将CONVERSATION_ID替换为Thread ID,我正在POST发送名为message的var

但它不会发布,是否有延长的许可?我只有read_page_inbox

1 个答案:

答案 0 :(得分:0)

对不起,我回错了帐号!!

CODE是这样的:

<?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}}

三江源!

相关问题