Add SMS Template

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

Add a template of short message service (SMS). The SMS content can be a verification code, message notification, or promotional message. The messages of verification codes and message notifications can be customized by replacing the variables.

API address

POST: /v1.0/iot-03/msg-templates/sms

Request parameter

Description of body

Parameter name Type IN Required Description
name String true The template name with 1 to 30 characters.
content String true The template content with 1 to 500 characters.
type Integer true The message type. Valid values:
  • 0: verification code.
  • 1: message notification.
  • 2: promotional message.
remark String true The remarks of the application for the message template. Describe your application scenario with 1 to 100 characters.

Return parameter

Parameter name Type Description
result MsgTemplatesRes

Description of result

Parameter name Type Description
template_id String Template ID.

Request example

POST: /v1.0/iot-03/msg-templates/sms
{ "name": "The template of the message verification code", "content": "You are registering with your phone number. The verification code is: ${code}, valid for 5 minutes.", "type": 0, "remark": "The current message template applies to the registration scenario" }

Return example

{ "result": { "template_id": "SMS_1616396456" }, "t": 1586153261345, "success": true }

Error code

For more information, see error code.