Sends a message to the Chinese mainland by using a message template.
Operation description
Usage notes
You can call the SendMessageWithTemplate operation to send messages only to the Chinese mainland.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dysms:SendMessageWithTemplate |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| To |
string |
Yes |
The mobile phone number to which the message is sent. You must add the country code to the beginning of the mobile phone number. Example: 861503871****. For more information, see Dialing codes. |
861503871**** |
| From |
string |
Yes |
The signature. To query the signature, log on to the Short Message Service (SMS) console and navigate to the Signatures tab of the Go China page. |
Alicloud321 |
| TemplateCode |
string |
Yes |
The code of the message template. To query the code, log on to the SMS console and navigate to the Templates tab of the Go China page. |
SMS_**** |
| TemplateParam |
string |
No |
The value of the variable in the message template. If a variable exists in the template, the parameter is required. |
{"code":"1234","product":"ytx"} |
| SmsUpExtendCode |
string |
No |
The extension code of the MO message. |
90999 |
| ValidityPeriod |
integer |
No |
The validity period of the message. |
1 |
| ChannelId |
string |
No |
The ID of the channel. |
5739 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| ResponseCode |
string |
The status code of the delivery request. |
OK |
| NumberDetail |
object |
The details about the mobile phone number of the recipient. |
|
| Carrier |
string |
The carrier that owns the mobile phone number. |
China Mobile |
| Region |
string |
The region to which the mobile phone number belongs. |
Nanjing, Jiangsu |
| Country |
string |
The country to which the mobile phone number belongs. |
China |
| ResponseDescription |
string |
The description of the delivery request status. |
The SMS Send Request was accepted |
| Segments |
string |
The number of messages that incurred fees. |
1 |
| To |
string |
The mobile phone number to which the message was sent. The dialing code was added to the beginning of the mobile phone number. Example: 861503871****. |
861503871**** |
| MessageId |
string |
The ID of the message. |
1**************3 |
| RequestId |
string |
The ID of the request. |
F655A8D5-B967-440B-8683-DAD6FF8D23D6 |
Examples
Success response
JSON format
{
"ResponseCode": "OK",
"NumberDetail": {
"Carrier": "China Mobile",
"Region": "Nanjing, Jiangsu",
"Country": "China"
},
"ResponseDescription": "The SMS Send Request was accepted",
"Segments": "1",
"To": "861503871****",
"MessageId": "1**************3",
"RequestId": "F655A8D5-B967-440B-8683-DAD6FF8D23D6"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.