Twilio:响应应用程序链接不工作

问题描述:

我正在解除Twilio Rest Api的SMS功能。我的短信发送成功问题是当用户对短信的响应时,我必须在我的应用程序中捕获该响应,并向用户发送确认电子邮件。Twilio:响应应用程序链接不工作

我无法捕获应用程序URL的响应。请给我一些想法。

预先感谢

+0

你有任何代码到目前为止,你做了什么? – Ziinloader 2013-03-01 08:41:54

+0

是的,我的代码如下。我已经在TwimL应用程序中设置了URL作为SMS URL:mywebsiteURL/replytosms和replytosms函数就像 – user2122778 2013-03-01 10:08:32

+0

我已经在TwimL应用程序中设置URL作为SMS URL:mywebsiteURL/replytosms和replytosms函数like function replytosms() \t { \t \t if(isset($ _REQUEST ['To'])) \t \t $ to = $ _REQUEST ['To']; \t \t $ fromBody = trim($ fromBody); \t \t \t \t \t如果(stristr($ fromBody, '是')== TRUE || stristr($ fromBody, 'Y')|| stristr($ fromBody, 'Y')) \t \t { \t \t $ response ='YES'; \t \t} \t \t别的 \t \t { \t \t $响应= '错误'; \t \t} \t \t开关($响应) \t \t { \t \t情况下的 '是': \t \t \t //发送消息 \t \t \t中断; \t \t case'ERROR': \t \t default:break; \t \t} //开关 \t} // replysms – user2122778 2013-03-01 10:15:20

该示例应用here in PHP显示了如何构建基于所述传入的文本消息的主体中的关键字的响应。

需要注意的重要一点是获取这简直是消息的Body request parameter

/* Read the contents of the `'Body'` field of the Request. */ 

$body = $_REQUEST['Body']; 

而不是“fromBody”。