Skip to main content

Send Verification Message

Request URI

/v1/send

HTTP Method

POST

Request Format

application/json

Request Parameters

Request ParameterParameter TypeRequired / DefaultExample ValueParameter Description
service_idstrRequired568ff29ec61a2ee7ead4ebd1c026e128Service ID
gen_timeintRequired1710496502Current timestamp, accurate to seconds
signaturestrRequired6197126a0d9ccb9e818deca9c7f16596
2df88e3a6ce2a1856fe7f42463e89d03
Signature information, see signature method
user_ipstrRequired1.2.3.4User IP address
user_agentstrOptionalMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0User agent
channelstrOptional, default "sms"smsDelivery channel, currently only supports SMS, i.e. "sms"
tostrRequired+6591201234Recipient, currently only supports phone numbers
verification_code_configobjectOptional Verification code generation parameters
 lengthintOptional, default 66Verification code length
 expireintOptional, default 55Verification code expiration time, in minutes
 generate_ruleintOptional, default 11Verification code generation rule:
1. pure digits
2. pure letters
3. digits and letters
4. letters and special characters (_$#@*%&)
 return_verification_codeboolOptional, default truetrueWhether to return the verification code after calling the API
sms_template_idstrRequired if channel is sms207406SMS template ID, can be obtained on the dashboard

Request Example

{
"service_id": "568ff29ec61a2ee7ead4ebd1c026e128",
"signature": "cbf7ac72f03162a486b3b418e7a032c8c085e21dc6a5f2469b141426c2001033",
"gen_time": 1710744053,
"user_ip": "1.2.3.4",
"to": "+6591201234",
"user_agent": "Go-http-client/1.1",
"sms_template_id": "207406",
"verification_code_config": {
"length": 8,
"expire": 7,
"generate_rule": 1,
"return_verification_code": true
}
}

Response Format

application/json

Response Parameters

Response ParameterParameter TypeRequiredParameter Description
request_idstrYesUnique identifier of this request
statusstrYes"success", "canceled" of "error", whether the request was successful
error_codeintReturned when status is "error"Error code
error_msgstrReturned when status is "error"Error message
service_idstrReturned when status is "success"Service ID, consistent with the parameter submitted in the request
channelstrReturned when status is "success"Delivery channel, currently only "sms"
verification_codestrReturned when request parameter verification_code_config.return_verification_code is true and status is "success"Generated verification code according to the rules

Response Example

Successful Example

{
"status": "success",
"channel": "sms",
"request_id": "svmxqdlxdzp6nyoxcsm7st6qjzvnrbse",
"service_id": "568ff29ec61a2ee7ead4ebd1c026e128",
"verification_code": "67557548"
}

Canceled Example

Why did you get the status 'canceled'?

This indicates that your send request has been blocked by our fraud protection system. You can adjust the appropriate protection level on the 'Fraud Protection' page under 'Security Setting'.

{
"status": "canceled",
"request_id": "8y8mr18vjykv48rond6am7surl8nwtaw",
"service_id": "0b3d9be94663520ab31fd903413e9174"
}

Failure Example

{
"status": "error",
"error_code": -50102,
"error_msg": "service not found or signature verify failed",
"request_id": "fvw0cj066cg4jegd3mwu9b8by31cidm3"
}