Get phone number of SMS sender, using Twilio

旧时模样 提交于 2019-12-06 05:37:07

When a user sends you an SMS, we make an HTTP request to your server. This HTTP request contains info about the SMS, such as the From, To, Body, etc.

To retrieve the 'From' value from the HTTP request in PHP, simply do the following:

$from_number = $_REQUEST['From'];

Alternately you can retrieve it from the REST API:

$message = $client->account->sms_messages->get($_REQUEST['SmsSid'])

Although this should be unneccessary as all the data you need should be in the HTTP request.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!