Why a Preset 6-Digit Verification Code Becomes a 5-Digit Verification Code After Being Sent?
[Symptom]
The Message&SMS service calls an API to send a 6-digit verification code. If the verification code starts with zero, the first zero is deleted and a 5-digit verification code is sent.
Cause Analysis
The variable templateParas in the template for the SMS Sending API is not set to a character string.
[Solution]
Set templateParas to a character string. Set templateParas based on code examples provided in the following table, or see examples in code examples.
Programming Language |
Code Example - SMS Sending API |
Code Example - Batch SMS Sending API |
---|---|---|
Java |
String templateParas = "[\"369751\"]"; |
String[] templateParas1 = {"123456"}; String[] templateParas2 = {"234567"}; |
PHP |
$TEMPLATE_PARAS = '["369751"]'; |
$TEMPLATE_PARAS_1 = ['123456']; $TEMPLATE_PARAS_2 = ['234567']; |
Python |
TEMPLATE_PARAM='["369751"]' |
TEMPLATE_PARAM_1 = ["123456"] TEMPLATE_PARAM_2 = ["234567"] |
C# |
string templateParas = "[\"369751\"]"; |
string[] templateParas_1 = {"123456"}; string[] templateParas_2 = {"234567"}; |
Node.js |
var templateParas = '["369751"]'; |
var templateParas1 = ['123456']; var templateParas2 = ['234567']; |
Secondary Development FAQs
- How Do I Obtain the Application Access Key from the Message & SMS Platform?
- How Do I Obtain the HTTPS Commissioning Certificate from the Message & SMS Platform?
- How Can I Get the Channel No. Required to Send a Short Message?
- Does SMS API Calling Have PHP and Java Version Requirements?
- Why a Preset 6-Digit Verification Code Becomes a 5-Digit Verification Code After Being Sent?
- What Is the Callback Address? How Do I Set This Address?
- Does the Message & SMS Service Support Privatized Deployment?
- Can the SMS API Be Called by an Internal Network (For Example, an ECS Server)?
- Why Can an SMS Sending Request to an Incorrect Recipient Number Be Successful?
- Must the Message & SMS API Request Address Be a Domain Name? Does the Service Provide a Fixed IP Address?
- Does Message & SMS Provide SDKs?
- Is the Message & SMS Service Affected If the Region Where the Service Is Enabled Is Different from the Region Where Servers Are Located?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbotmore