Sends a text message to a region outside mainland China. You cannot send the text message to mainland China. Each Alibaba Cloud account that uses the subscription billing method can run a maximum of 30 queries per second (QPS).

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.

To String Yes 861245567****

The mobile phone number to receive the text message. You must add the country code to the beginning of the mobile phone number. Example: 861245567 ****.

From String No Alicloud

The identifier 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.

TaskId String No 123xxx789

The ID of the task.

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 1008030300****

The ID of the text message.

NumberDetail Struct

The details about 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.

RequestId String F655A8D5-B967-440B-8683-DAD6FF8DE990

The ID of the request.

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
&To=861245567****
&From=Alicloud
&Message=Hello
&TaskId=123****789
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

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