Get template info
Description
Retrieves a single message template information.
Request URL
Method: POST
https://example.com/api/v1.1/templates/get
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
format | string | "json" | No | Response data format. By default – json |
id | int | 1 | Yes | Template ID |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 1
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>1</id>
</xml>
Response example
- JSON
- XML
{
"data": {
"id": 1,
"name": "Title",
"description": "Description",
"channels": [
{
"id": 1,
"sid": "email",
"fields": {
"text": "Text version of message",
"html": "<html>Hello, world!</html>",
"subject": "Theme",
"from_email": "",
"from_name": "",
"replyto_email": "",
"replyto_name": "",
"is_not_inline": true,
"attach": []
},
"presets": null
},
{
"id": 2,
"sid": "sms",
"fields": {
"sms": "Hello, world!",
"sms_max_count": 0,
"add_sms_url_scheme": false
},
"presets": null
},
{
"id": 4,
"sid": "push",
"fields": {
"title": "Header",
"body": "Hello, world!",
"icon": "",
"click_url": "ttps://example.com",
"click_url_new": {
"uniq": false
},
"custom_push_json_raw": "{}"
},
"presets": null
}
],
"json_url": "https://example.com/examples/message.json",
"is_draft": true,
"is_confirm": true,
"ui_tags": [
"E-commerce",
"B2C"
],
"groups": [
{
"id": 2,
"name": "Sales"
},
{
"id": 3,
"name": "Marketing"
}
],
"suppress_id": 1
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<id>1</id>
<name>Title</name>
<description>Description</description>
<channels>
<id>1</id>
<sid>email</sid>
<fields>
<text>Text version of message</text>
<html><html>Hello, world!</html></html>
<subject>Theme</subject>
<from_email>noreply@example.com</from_email>
<from_name>Awesome Books</from_name>
<replyto_email></replyto_email>
<replyto_name></replyto_name>
<is_not_inline>true</is_not_inline>
<attach array='true'></attach>
</fields>
<presets></presets>
</channels>
<channels>
<id>2</id>
<sid>sms</sid>
<fields>
<sms>Hello, world!</sms>
<sms_max_count>0</sms_max_count>
<add_sms_url_scheme>false</add_sms_url_scheme>
</fields>
</channels>
<channels>
<id>4</id>
<sid>push</sid>
<fields>
<title>Header</title>
<body>Hello, world!</body>
<icon></icon>
<click_url>https://example.com</click_url>
<click_url_new>
<uniq>false</uniq>
</click_url_new>
<custom_push_json_raw>{}</custom_push_json_raw>
</fields>
</channels>
<json_url>https://example.com/examples/message.json</json_url>
<is_draft>true</is_draft>
<is_confirm>true</is_confirm>
<ui_tags>E-commerce</ui_tags>
<ui_tags>B2C</ui_tags>
<groups>
<id>2</id>
<name>Sales</name>
</groups>
<groups>
<id>3</id>
<name>Marketing</name>
</groups>
<suppress_id>1</suppress_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
id | int | Template ID |
name | string | Template name |
description | string | Template description |
channels | array of objects | Tempalte settings data for each channel |
json_url | string | Dynamic JSON URL |
is_draft | bool | Draft template flag. If this is a draft, the template cannot be sent. |
is_confirm | bool | Confirm subscription link flag. Is there a confirmation link in the body of the email or not. |
ui_tags | []String | List of tags to search |
groups | array of objects | List of groups |
suppress_id | int | Suppression list ID |