Get the list of SMS templates

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

Get the list of SMS templates.

API address

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

Request parameter

Parameter nameTypeINRequiredDescription
page_noIntegerqueryfalseThe page number. Query the first page if this parameter is not entered.
page_sizeIntegerqueryfalseThe page size. It is 10 by default if this parameter is not entered.
sortIntegerqueryfalseSort the results. 0: Sort by creation time in ascending order. 1: Sort by creation time in descending order. The results are sorted by creation time in descending order if this parameter is not entered.

Return parameter

Parameter nameTypeDescription
resultTemplatesListRes

Description of result

Parameter nameTypeDescription
totalLongThe total number of template lists.
listListThe list of templates.
has_moreBooleanWhether there is a next page.

Description of has_more

Parameter nameTypeDescription
template_idStringTemplate ID.
nameStringThe template name with 1 to 40 characters.
contentStringThe template content with 1 to 60 characters.
statusIntegerThe review status of the template. 0: The review is in progress. 1: Passed the review. 2: Failed to pass the review.

Request example

GET: /v1.0/iot-03/msg-templates/sms?page_no=1&page_size=10&sort=1
? page_no=1&page_size=10&sort=1

Return example

{
    "result": {
        "list": [
            {
                "content": "You are registering an account. The verification code is: ${code}, valid for 5 minutes.",
                "name": "The SMS verification code",
                "template_id": "a5s59kn**",
                "status": 1
            }
        ],
        "total": 1,
        "has_more": false
    },
    "t": 1586153261345,
    "success": true
}

Error code

For more information, see error code.