Get templates list
Description
Retrieves a list of message templates.
Request URL
Method: POST
https://example.com/api/v1.1/templates/list
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
format | string | "json" | No | Response data format By default– json |
from_id | int | 1 | No | The first template ID in the list. By default – 1 |
limit | int | 100 | No | Message list limit. By default – 1000 |
channel | string | "email" "sms" "push" "telegram_bot" "telegram_group" "custom_channel" | No | The channel that uses the template By default – all channels |
ui_tags | [string] | [ "tag1", "tag2" ] | No | List of tags to search By default – [] |
groups | [string] | [ "group1", "group2" ] | No | List of groups By default – [] |
groups_id | [int] | [ 0, 1 ] | No | List of group IDs By default – [] |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"limit": 2
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<limit>2</limit>
</xml>
Response example
- JSON
- XML
{
"data": [
{
"id": 1,
"name": "Message A",
"channels": [
"email"
]
},
{
"id": 2,
"name": "Message B",
"channels": [
"push"
]
}
],
"error": 0,
"error_text": "Successful operation",
"total_count": 10
}
<xml>
<data>
<id>1</id>
<name>Message A</name>
<channels>email</channels>
</data>
<data>
<id>2</id>
<name>Message B</name>
<channels>push</channels>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
<total_count>10</total_count>
</xml>
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
total_count | int | Total number of templates |
id | int | Message template ID |
name | string | Template name |
channels | array | Channels for which the template is configured |
is_draft | bool | If this is a draft, the template cannot be sent. |
is_confirm | bool | Is there a confirmation link in the body of the email or not. |
ui_tags | []String | List of tags |
groups | array of objects | List of groups (group ID + group name) |