Skip to main content

Update template

Description

Add a new message template.

Request URL

Method: POST

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

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"json"NoResponse data format
By default– json
idint1YesTemplate ID
namestring"Subscription confirmation template"YesTemplate name
descrstring"Template used in Double Opt-In scenario"NoTemplate description
channels[]channels
"channels": [
   {
      "sid": "email",
      "fields":{
         "text": "Hello, world!",
         "html": "Hello, world!",
         "subject": "Subject line",
         "from_email": "",
         "from_name": "",
         "replyto_email": "",
         "replyto_name": ""
      }
   }
]
YesTemplate settings for a certain channel.

Learn more
json_urlstring"https://altcraft.com/public/assets/example/test.json"NoLink to dynamic JSON content
ui_tags[string]["tag_1","tag_2"]NoList of tags
groups[int][1,2]NoList of group IDs
is_draftboolfalseNoDraft template flag.
If this is a draft, the template cannot be sent.
is_confirmbooltrueNoConfirm subscription link flag.

Is there a confirmation link in the body of the email or not.
suppress_idint2NoSuppression list ID

Request example

{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 10,
"name": "Название шаблона",
"descr": "Описание шаблона",
"channels": [
{
"sid": "email",
"fields": {
"text": "Текстовая версия письма",
"html": "<html>Hello, world!</html>",
"subject": "Шаблон сообщения",
"from_email": "",
"from_name": "",
"replyto_email": "",
"replyto_name": "",
"is_not_inline": true
}
}
],
"json_url": "https://altcraft.com/public/assets/example/test.json",
"ui_tags": ["tag_1", "tag_2"],
"groups": [],
"is_draft": false,
"is_confirm": false,
"suppress_id": 4
}

Response example

{
"data": {
"saved_id": 10
},
"error": 0,
"error_text": "Successful operation"
}

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
saved_idstringUpdated template ID