Send SMS messages

Last Updated on : 2023-06-20 12:39:04download

Send verification codes, notifications, or marketing SMS messagesto users.

API address

POST: /v1.0/iot-03/messages/sms/actions/push

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
country_codeString trueThe country code.
phoneString trueThe phone numbers that receive the messages.
template_idString trueThe SMS template ID. Enter the template ID that has been approved.
template_paramString falseThe actual value corresponding to the message template variable, in the JSON format.
sign_nameString falseThe SMS signature.

Return parameter

Parameter nameTypeDescription
resultMsgPushRes

Description of result

Parameter nameTypeDescription
send_statusBooleanThe status of sending a specified message.

Request example

POST: /v1.0/iot-03/messages/sms/actions/push
{
  "country_code": "86",
  "phone": "151********",
  "template_id": "SMS_1616396456",
  "template_param": "{\"code\":\"1234\"}"
}

Return example

{
    "result": {
        "send_status": true
    },
    "t": 1586153261345,
    "success": true
}

Error code

For more information, see error code.