All Products
Document Center


Last Updated: Nov 26, 2019

Input parameters

Name Type O/M Description
To String Mandatory The format of a phone number: Country Code + Phone Number
From String Optional Sender ID supported, please refer to (Regulation of Sender ID
Message String Mandatory This is the text sending to the target phone number.

Output parameters

Name Type Example Description
MessageId String 10080303003003 The ID generated by Alibaba Cloud, to uniquely identify the serial number of SMS sending request.
To String 6531177810 The format of a phone number: Country Code + Phone Number
From String Alicloud Sender ID supported,please refer to (Regulation of Sender ID)
ResponseCode String OK This code indicates whether the SMS Send request is accepted by Alibaba Platform or has not been accepted.“OK” indicates the request is accepted.Other codes indicate different errors. The details please go to the StatusCode list.
ResponseDescription String The SMS Send Request was accepted The description of different Status Code.
Segments String 1 The number of parts into which Alibaba Cloud split.
NumberDetail String Detailed information of the number
└Country String Hongkong, China Number Country
└Region String HongKong Number Region
└Carrier String CMI Number Carrier/Network

Developer integration process

1.Core-sdk import

Use Composer to install, click to view the download address

2.Writing a sample program

When calling the interface, please note:

  • The regionId must be “ap-southeast-1”, please do not modify it.
  • product must be “Dysmsapi”, please do not modify it.
  • host must be “”, please do not modify it.
  • version must be 2018-05-01, please do not modify it.
  1. <?php
  2. use AlibabaCloud\Client\AlibabaCloud;
  3. use AlibabaCloud\Client\Exception\ClientException;
  4. use AlibabaCloud\Client\Exception\ServerException;
  5. // Download:
  6. // Usage:
  7. AlibabaCloud::accessKeyClient('<accessKeyId>', '<accessSecret>')
  8. ->regionId('ap-southeast-1')
  9. ->asGlobalClient();
  10. try {
  11. $result = AlibabaCloud::rpcRequest()
  12. ->product('Dysmsapi')
  13. ->host('')
  14. ->version('2018-05-01')
  15. ->action('SendMessageToGlobe')
  16. ->method('POST')
  17. ->options([
  18. 'query' => [
  19. "To" => "6212345678901",
  20. // "From" => "1234567890",
  21. "Message" => "have a test.",
  22. ],
  23. ])
  24. ->request();
  25. print_r($result->toArray());
  26. } catch (ClientException $e) {
  27. echo $e->getErrorMessage() . PHP_EOL;
  28. } catch (ServerException $e) {
  29. echo $e->getErrorMessage() . PHP_EOL;
  30. }