Sends a text message to a region outside Mainland China.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No SendMessageToGlobe

The operation that you want to perform. Set the value to SendMessageToGlobe.

Message String Yes Hello

The content of the text message.

TaskId String Yes 123xxx789

The ID of the precheck task.

To String Yes 12455xxx67

The mobile phone numbers to receive the text messages. You must add the country code to the beginning of each mobile phone number. For example, 12455 xxx67.

From String No Alicloud

The ID of the sender. You can specify the sender ID when you call the API operation. The sender ID can contain digits and letters. If the sender ID contains only letters, the sender ID can be a maximum of 11 characters in length. If the sender ID contains only digits, the sender ID can be a maximum of 15 characters in length.

Response parameters

Parameter Type Example Description
From String Alicloud

The ID of the sender that was returned. The API operation returns the sender ID that you have specified in the request parameters.

MessageId String 1008030xxx3003

The ID of the text message.

NumberDetail Struct

The details of the mobile phone number.

Carrier String CMI

The carrier that provides the mobile phone number.

Country String Hongkong, China

The country to which the mobile phone number belongs.

Region String HongKong

The region to which the mobile phone number belongs.

ResponseCode String OK

The status code that indicates whether the request of sending the text message was submitted.

ResponseDescription String The SMS Send Request was accepted

The detailed description of the status code that indicates whether the request of sending the text message was submitted.

Segments String 1

The number of the text messages that incurred fees.

To String "123"

The mobile phone number that received the text message.

Examples

Sample requests

http(s)://dysmsapi.ap-southeast-1.aliyuncs.com? Action=SendMessageToGlobe
&Message=xxxx
&TaskId=123xxx789
&To="123"
&From=Alicloud
&<Common request parameters>

Sample success responses

XML format

<SendMessageToGlobeResponse>
      <From>Alicloud</From>
      <MessageId>1008030xxx3003</MessageId>
      <NumberDetail>
            <Carrier>CMI</Carrier>
            <Country>Hongkong,China</Country>
            <Region>HongKong</Region>
      </NumberDetail>
      <ResponseCode>OK</ResponseCode>
      <ResponseDescription>The SMS Send Request was accepted</ResponseDescription>
      <RequestId>F655A8D5-B967-440B-8683-DAD6FF8DE990</RequestId>
      <Segments>1</Segments>
      <To>123</To>
</SendMessageToGlobeResponse>

JSON format

{
    "From": "Alicloud",
    "MessageId": "1008030xxx3003",
    "NumberDetail": {
        "Carrier": "CMI",
        "Country": "Hongkong,China",
        "Region": "HongKong"
        },
    "ResponseCode": "OK",
    "ResponseDescription": "The SMS Send Request was accepted",
    "RequestId": "F655A8D5-B967-440B-8683-DAD6FF8DE990",
    "Segments": "1",
    "To": ["123"]
}

Error code

For a list of error codes, visit the API Error Center.