Facebook API发送消息:如何发送链接

时间:2019-05-08 12:11:58

标签: facebook facebook-messenger

我使用Facebook应用程序发送消息,消息是文本

我要在邮件中发送链接。

这是我的代码:

$message_to_reply = '<a href="http://test.com">hello</a>';


$ch = curl_init($url);
$jsonData = '{
    "recipient":{
        "id":"' . $sender . '"
    },
    "message":{
        "text":"' . $message_to_reply . '"
    }
}';

$jsonDataEncoded = $jsonData;

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));

但这不起作用。

0 个答案:

没有答案
相关问题