你必须做这样的事情: -
$auth_id = 'PLIVO_AUTHID';
$auth_token = 'PLIVO_AUTHTOKEN';
$p = new RestAPI($auth_id, $auth_token);
// Set message parameters
$params = array(
'src' => '1111111111', // Sender's phone number with country code
'dst' => '2222222222', // Receiver's phone number with country code
'text' => 'Hi, Message from Plivo', // Your SMS text message
//'url' => 'http://example.com/report/', // The URL to which with the status of the message is sent
'method' => 'GET' // The method used to call the url
);
// Send message
$response = $p->send_message($params);
// Print the response
echo "Response : ";
print_r ($response['response']);
// Print the Api ID
echo "<br> Api ID : {$response['response']['api_id']} <br>";
// Print the Message UUID
echo "Message UUID : {$response['response']['message_uuid'][0]} <br>";
如果你得到这样的回应:-
Response : Array ( [api_id] => 2c5af359-1c06-11e6-8a00-22000ae28743 [message] => message(s) queued [message_uuid] => Array ( [0] => 0f2afda3-b869-45f6-9baf-13acc1992cb8 ) ) Api ID : 2c5af359-1c06-11e6-8a00-22000ae28743 Message UUID : 0f2afda3-b869-45f6-9baf-13acc1992cb8
这意味着您的消息已发送。