我已经在twilio上创建了试用帐户,并使用测试API凭据发送短信,在发送短信后,它显示我成功了SID但没有通过我添加的电话号码收到的消息' TO&#39 ;字段。
答案 0 :(得分:0)
您必须使用实时凭据send messages:
<?php
// this line loads the library
require('/path/to/twilio-php/Services/Twilio.php');
// you must use your live credentials!!!!
$account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$auth_token = '[AuthToken]';
$client = new Services_Twilio($account_sid, $auth_token);
$client->account->messages->create(array(
'To' => "+15558675309",
'From' => "+15017250604",
'Body' => "Hey, hope this works!",
'MediaUrl' => "http://farm2.static.flickr.com/1075/1404618563_3ed9a44a3a.jpg",
));
此处说明 - https://www.twilio.com/docs/api/rest/test-credentials - 测试凭据无法连接到真实的电话号码。