To test Short Message Service before your application goes live, send a testing message from the console or by calling the API.
Usage notes
You can only send test messages to recipients in the Chinese mainland.
Test messages can be sent only to authorized mobile numbers. Each Alibaba Cloud account can have a maximum of five authorized test mobile numbers, which you can bind in the console.
Test messages are subject to limits, such as the total number of messages and sending frequency. Be aware of these limits to avoid interruptions during testing.
If you use a custom message template with variables to send test messages, pass parameters as you would in a production environment. The message may be blocked if parameters do not match the variable specifications or differ significantly from your business scenario.
Sending test messages is a paid service. Before you send messages, ensure you have a sufficient message package balance or account balance. Charges are first deducted from your message package. If the package quota is exceeded, charges are billed on a pay-as-you-go basis and deducted from your account balance. For more information, see Billing overview.
Before you begin
Before sending test messages, you must submit your qualifications, signature, and template for approval. You can proceed only after they are approved. Additionally, the real-name registration for your signature must be complete.
After your signature is approved, its status becomes Filed pending verification. You must send actual text messages to dynamically verify channel availability and trigger supplementary carrier filing. If you do not actively send messages, the filing process progresses slowly and some carrier channels may remain inactive.
Apply for qualifications: Log on to the GoChina - Qualification Management page in the console and complete the application. Qualification descriptions | Instructions
Apply for a signature: Log on to the GoChina - Signature Management page in the console. Review rules | Real-name registration for signatures | Instructions
Apply for a template: Log on to the GoChina - Template Management page in the console. Review rules | Instructions
Procedure
Sign up for an Alibaba Cloud account, complete real-name verification, and activate Short Message Service.
Log on to the Quick Learning and Test page of the Short Message Service console.
In the Send Test Message section, select API or Console.
Authorize mobile numbers to receive test messages. Click Bind a mobile number for testing, and then enter the mobile number and the verification code you receive.
NoteYou can send test messages only to authorized (bound) mobile numbers.
Unbind a mobile phone number: Delete the mobile phone number in the console.
API
|
|
|
Common API parameter errors and troubleshooting
If your test messages fail to send, check the following common parameter issues:
Parameter | Requirement | Common errors |
SignName | Enter the full exact name of an approved signature. No extra spaces or special characters. The value must match your code configuration exactly. | Extra spaces in the signature name; using a signature that has not been approved; mismatch between the code and the actual signature name. |
TemplateParam | Must be in JSON format. Example: | Non-JSON format; variable values that violate type constraints (such as letters in a digits-only verification code field); incorrect variable key names. |
TemplateCode | Enter the correct template code. Signatures and templates can be freely combined. You do not need to use the associated signature shown in the template details page. | Entering the wrong template code; assuming the template can only be used with its originally associated signature. |
Console
Enter the following information:
Product Type: Select Domestic.
Signature: Select an approved signature.
Template: Select an approved template.
To: Enter an authorized (bound) test mobile number.
Click Send SMS.
Query sending details
You can check the sending details of sent messages in the following ways:
In the console: In the left-side navigation pane, choose Statistics > Delivery Records. On this page, you can view message details by filtering by sending time, message content, and other criteria.
By API: Call the QuerySendDetails API to retrieve sending details.
Via delivery receipts: Configure delivery receipts and develop an integration to receive them. Both the lightweight message queue consumption mode and HTTP batch push mode are supported.
Next steps
After testing Short Message Service, follow these steps to use it in your production environment.
Send multiple small batches of test messages for carrier channel activation: After your signature and template are approved, send messages to mobile phone numbers of the three major carriers (China Mobile, China Unicom, and China Telecom). We recommend sending 10 to 20 or more messages per carrier per day for 5 to 7 business days to trigger supplementary carrier filing and activate channels. You can reuse the same set of phone numbers for repeated sends, but avoid triggering rate limits.
NoteYou do not need to wait for the console filing status to change. Once your actual delivery success rate is stable and meets your business expectations, you can put the service into production.
Send messages by using Mass Messaging: Log on to the GoChina - Mass Messaging page in the console. For detailed instructions, see Send mass messages.
Send messages by calling an API: See the API reference for SendSms and SendBatchSms.