Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guideDeveloper guideAdmin guide
Company siteHelp center
English
  • Русский
  • English
v72
  • v74
  • v73
  • v72
Login
  • User API documentation
  • API interaction
  • Matching
  • Profiles
  • Databases
  • Resources
  • Segments
  • Static segments
  • Suppression lists
  • Templates and fragments
    • Get templates list
    • Get template info
    • Delete template
    • Add template
    • Update template
    • Channel object
  • Campaigns
  • Automation scenarios
  • Promo codes
  • Goals
  • Application push notifications
  • Market
  • Analytic reports
  • SendersDevv71
  • External datatables queries
  • Objects
  • Miscellaneous
  • Importing the API collection in Postman
  • List of API endpoints
  • SDK
This is documentation for Altcraft Platform v72. This documentation is no longer maintained.
The information for up-to-date platform version at this page is available (v74).
  • Templates and fragments
  • Add template
Documentation for version v72

Add template

Description​

Adds a new message template.

Request URL​

Method: POST

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

Request parameters​

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"json"NoResponse data format
By default– json
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​

info

Every template should contain unsubscribe link.

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"name": "Subscription confirmation template",
"descr":"Template used in Double Opt-In scenario",
"channels": [
{
"sid": "email",
"fields": {
"text": "Hello, world!",
"html": "<html>Hello, world!</html>",
"subject": "Тема письма",
"from_email": "",
"from_name": "",
"replyto_email": "",
"replyto_name": "",
"is_not_inline": true
}
}
]
"json_url": "https://altcraft.com/example/message.json",
"ui_tags": ["tag_1","tag_2"],
"groups": [1,2],
"is_draft": false,
"is_confirm": false,
"suppress_id": 2
}

<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<name>Template</name>
<descr>Template description</descr>
<channels array = 'true'>
<fields>
<body>Hello, world!</body>
<click_url>https://example.com</click_url>
<icon>https://example.com/images/picture.jpg</icon>
<title>Welcome</title>
</fields>
<sid>push</sid>
</channels>
<is_confirm>false</is_confirm>
<is_draft>false</is_draft>
<json_url>https://altcraft.com/example/message.json</json_url>
<suppress_id>2</suppress_id>
<groups>1</groups>
<groups>2</groups>
<ui_tags>tag_1</ui_tags>
<ui_tags>tag_2</ui_tags>
</xml>

Response example​

  • JSON
  • XML
{
"data": {
"saved_id": 10
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<saved_id>10</saved_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>

Response parameters​

ParameterTypeDescription
errorintError code
error_textstringError text
saved_idstringCreated template ID
Last updated on Apr 14, 2022
Previous
Delete template
Next
Update template
  • Description
  • Request URL
  • Request parameters
  • Request example
  • Response example
  • Response parameters
© 2015 - 2025 Altcraft, LLC. All rights reserved.