Updated on 2022-12-29 GMT+08:00

Querying Template Variables

Function

This API is used to query template variables.

URI

GET /v2/{project_id}/msgsms/templates/{id}/varilable

Table 1 URI parameters

Parameter

Mandatory

Type

Description

id

Yes

String

Primary key ID of the template, which is the value of id in Table 5.

project_id

Yes

String

Project ID. For details, see Obtaining Account, User, and Project Information.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Request body parameter type. This parameter must be set to application/json.

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token.

Response Parameters

Table 3 Response body parameters

Parameter

Type

Description

results

Array of ApiTemplateVariable

Query result.

total

Long

Total number.

Table 4 ApiTemplateVariable

Parameter

Description

id

Variable ID.

temp_name

Template name.

variable_index

Variable index.

variable_type

Variable type.

variable_length

Variable length.

variable_desc

Variable description.

Request Example

GET /v2/845ada5bc7444f1295cd517af0123da1/msgsms/templates/f063a294-06ab-420e-90bc-0c4dd9aed540/varilable 
Host: 100.85.***.***:30300
Content-Type: application/json
X-Auth-Token:******

Response Example

{
    "results": [
        {
            "id": 15003394,
            "user_name": null,
            "temp_name": "Test",
            "variable_index": 1,
            "variable_type": "URL",
            "variable_length": 99,
            "variable_desc": ""
        }
    ],
    "total": 1
}

Returned Values

Status Code

Description

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

500

System error