我正在使用Twilio PHP库但问题实际上与语言无关.我尝试做类似以下的事情:
$client = new Services_Twilio('MyAccountSID', 'My auth token');
$client->account->calls->create($from_number, $to_number, $url_or_AppSID, array(
'TwilioParam1' => 'value1',
'TwilioParam2' => 'value2',
'MyCustomParameter1' => 'CustomValue1',
'MyCustomParamete2' => 'CustomValue2'
));
Run Code Online (Sandbox Code Playgroud)
然后我希望在Twilio请求我的$ url_or_AppSID(我的TwiML应用程序)时收到这些参数,但它没有发生.我知道可能的方法是在查询字符串中添加这些参数并在$ url_or_AppSID参数中传递我的自定义URL,但这迫使我设置GET方法,我想通过POST请求传递我的自定义参数,而不是GET .也许我必须使用已经通过POST注册的请求URL的AppSID.
有没有办法使用POST方法传递自定义参数?
我是Twilio的新手,目前在设计出站拨号程序时遇到一个问题,即预览拨号。如果工人拒绝一项任务,则不应再向该工人提供同一任务。如何处理这种情况?
无论如何我可以关闭默认的twilio哔声来开始录音.我想用自己的客户嘟嘟声.
基本上我们想在MP3完成播放时发出一声嘟嘟声.之后我们想要20秒空白并且一旦完成20秒,我们会发出三声嘟嘟声,这样他就可以开始录制他的答案了.
3月,我开设了一个网站,向人们提供临时号码,以用于接收SMS验证等。
我刚刚登录到该帐户,意识到我已经收到大量出站SMS费用。
每当我的任何号码收到短信时,它们似乎都是默认的自动回复。
我没有启用它(似乎好像在他们这边赚钱一样)。如何禁用它?
我试图通过 Twilio PHP 帮助程序库获取所有会议的列表,但出现 404 错误。我的代码:
$client = new Client($accountSid, $authToken);
foreach ($client->conferences->read() as $conference) {
var_dump($conference);
}
Run Code Online (Sandbox Code Playgroud)
错误:
[HTTP 404] Unable to fetch page: The requested resource /2010-04-01/Accounts/twilio.account_sid/Conferences.json was not found
Run Code Online (Sandbox Code Playgroud)
我在这里先向您的帮助表示感谢!
从我的api发送twilio消息会返回此错误
Twilio发送消息未找到所请求的资源/2010-04-01/Accounts//Messages.json
这就是我发送消息的方式.有人遇到过问题吗?
$this->client = new \Services_Twilio($sid, $token);
return $this->client->account->messages->sendMessage($from ,$to, $message);
Run Code Online (Sandbox Code Playgroud)
这是我遵循的文档
https://www.twilio.com/docs/api/rest/sending-sms
我如何创建Messages.json
我在laravel 4.2上使用了这个https://github.com/twilio/twilio-php
我让 twilio 工作了一段时间,但我想进行一些更改并将发送错误所带来的数字保存在数据库中以避免再次发送它们,不知何故,Twilio 停止工作。我从没有显示错误的浏览器中使用它,但是当我尝试从命令行运行脚本文件时出现了这些错误。
任何帮助表示赞赏。
PHP Notice: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL' in /var/www/twilio/twilio-php-master/Twilio/Http/CurlClient.php on line 80
PHP Notice: Use of undefined constant CURLOPT_HEADER - assumed 'CURLOPT_HEADER' in /var/www/twilio/twilio-php-master/Twilio/Http/CurlClient.php on line 81
PHP Notice: Use of undefined constant CURLOPT_RETURNTRANSFER - assumed 'CURLOPT_RETURNTRANSFER' in /var/www/twilio/twilio-php-master/Twilio/Http/CurlClient.php on line 82
PHP Notice: Use of undefined constant CURLOPT_INFILESIZE - assumed 'CURLOPT_INFILESIZE' in /var/www/twilio/twilio-php-master/Twilio/Http/CurlClient.php on line 83
PHP Notice: Use of undefined constant CURLOPT_HTTPHEADER - assumed 'CURLOPT_HTTPHEADER' in /var/www/twilio/twilio-php-master/Twilio/Http/CurlClient.php on line 84 …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用twilio php api.
这是我的代码:
<?php
$sid = "xxxxxx";
$token = "xxxxxxx";
$phone=$_POST["phone"];
$code=$_POST["code"];
$client = new Twilio\Rest\Client($sid, $token);
$message = $client->messages->create(
$phone,
array(
'from' => 'xxxxxxx',
'body' => $code
));
Run Code Online (Sandbox Code Playgroud)
它给了我这个错误:
致命错误:第9行的/home/vhosts/xxxx.xxxx.com/twilio/sms.php中找不到"Twilio\Rest\Client"类
我也尝试过这段代码但没有用:
<?php
$sid = "xxxxxxx";
$token = "xxxxxxxx";
require_once "Twilio/autoload.php";
use Twilio\Rest\Client;
$phone=$_POST["phone"];
$code=$_POST["code"];
$client = new Client($sid, $token);
$message = $client->messages->create(
$phone,
array(
'from' => 'xxxxx',
'body' => $code
));
Run Code Online (Sandbox Code Playgroud)
它给了我这个错误:
致命错误:require():无法打开所需的'/home/vhosts/xxxx.xxxxx.com/twilio/Twilio/Version.php'(include_path ='.:/ usr/share/pear:/ usr/share/php' )在第140行的/home/vhosts/xxxx.xxxx.com/twilio/Twilio/autoload.php中
我已经使用 Twilio api 发送通知消息。消息发送正常。
$notification = $client
->notify->services($serviceSid)
->notifications->create([
"toBinding" => [
'{"binding_type":"sms", "address":"+971444444444"}',
'{"binding_type":"sms", "address":"+971444444445"}'
],
'body' => 'Test message 8'
]);
Run Code Online (Sandbox Code Playgroud)
请求的响应是 201 并返回以'NT'. 如何跟踪此消息的状态?
当呼叫连接或振铃时 twilio 显示第二个。即使在接收到 twilio 后结束呼叫时,也会在呼叫连接时的回调中发送持续时间。但它应该在接到电话时。任何人都可以让我知道解决方案吗?
我在twillio 的github php quickstart上创建了一个问题。