Skip to main content

Get template info

Description

Retrieves a single message template information.

Request URL

Method: POST

https://example.com/api/v1.1/templates/get

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"json"NoResponse data format.
By default – json
idint1YesTemplate ID

Request example

{
"id": 1,
"token": "abcdefghijklmnqrstuvwxyz"
}

Response example

{
"data": {
"id": 1,
"name": "Halloween Promotion",
"description": "This template will be used in the newsletter on October 30th.",
"channels": [
{
"id": 1,
"sid": "email",
"fields": {
"text": "Text version of the message",
"html": "<html>Hello, world!</html>",
"subject": "Subject line",
"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": "Push notification title",
"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 department"
},
{
"id": 3,
"name": "Marketing department"
}
],
"suppress_id": 1
},
"error": 0,
"error_text": "Successful operation"
}

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
idintTemplate ID
namestringTemplate name
descriptionstringTemplate description
channelsarray of objectsTempalte settings data for each channel
json_urlstringDynamic JSON URL
is_draftboolDraft template flag.
If this is a draft, the template cannot be sent.
is_confirmboolConfirm subscription link flag.
Is there a confirmation link in the body of the email or not.
ui_tags[]StringList of tags to search
groupsarray of objectsList of groups
suppress_idintSuppression list ID