接收短信Twilio Webhook

时间:2019-05-10 13:49:02

标签: twilio

我是Twilio的新手,并试图按照该指南进行设置,以设置向在Google云上托管的服务器发送和接收SMS的功能,

我安装了Twilio SDK,外发消息运行良好,但是对于传入消息,我被卡住了,

我尝试按照此处的步骤操作:https://www.twilio.com/docs/sms/tutorials/how-to-receive-and-reply-php 但无法弄清楚。

我创建了这段代码ReplyToMessage.php

<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php

require_once 'vendor/autoload.php'; // Loads the library
use Twilio\Twiml;

$response = new Twiml;
$response->message("The Robots are coming! Head for the hills!");
print $response;

,然后将Twilio上的Webhook更新为http://myServer/replyToMessage.php Twilio

但是当我尝试发送消息时,它得到一个错误:

错误11200,尝试检索该URL的内容失败

说明 尝试检索此URL的内容失败

当我尝试查看服务器是否侦听HTTP请求时。我用该代码创建了一个代码test.php:

<?php

echo 'Hello, How World';

?>

并尝试从浏览器http://MyServerIp/test.php调用

0 个答案:

没有答案
相关问题