Channel object
Used in API requests related to adding and updating message templates.
- JSON
{
"sid": "email",
"fields": {
"text": "Hello, world!",
"html": "<html>Hello, world!</html>",
"subject": "Welcome"
}
},
{
"sid": "sms",
"fields": {
"sms": "Hello, world!"
}
},
{
"sid": "push",
"fields": {
"title": "Welcome",
"body": "Hello, world!",
"icon": "https://example.com/images/picture.jpg",
"click_url": "https://example.com"
}
}
Description
Parameter | Type | Example | Description |
---|---|---|---|
sid | string | "email" "sms" "push" "telegram_bot" "telegram_group" "custom_channel" | Channel name |
fields | object | "fields":{ | Template settings for a certain channel |
Fields object
Each channel
object contains a fields
object:
Email fields
- JSON
{
"sid": "email",
"fields": {
"text": "Hello, world!",
"html": "<html>Hello, world!</html>",
"subject": "Subject line",
"from_email": "test@example.com",
"from_name": "Jenny's List",
"replyto_email": "test_reply@example.com",
"replyto_name": "Jenny",
"is_not_inline": true
}
}
Description
Parameter | Type | Example | Description |
---|---|---|---|
text | string | "Hello, world!" | Text version of the message |
html | string | "<html>Hello, world!</html>" | HTML version of the message |
is_amp | bool | false | Is there an amp version in the template or not |
amp | string | "<html>Hello, world!</html>" | AMP HTML version of the message |
subject | string | "Weather alert" | Subject line |
from_email | string | "test@example.com" | Override "from-email" |
from_name | string | "Jenny's List" | Override "from-name" |
replyto_email | string | "test_reply@example.com" | Override "replyto_email" |
replyto_name | string | "Jenny" | Override "replyto_name" |
is_not_inline | bool | true | Do not convert CSS to inline |
SMS fields
- JSON
{
"sid": "sms",
"fields": {
"sms": "Hello, world!",
"sms_max_count": 0,
"add_sms_url_scheme": true
}
}
Description
Parameter | Type | Example | Description |
---|---|---|---|
sms | string | "Hello, world!" | Message text |
sms_max_count | int | 0 | SMS limit |
add_sms_url_scheme | bool | true | Add "http://" to links |
Push fields
- JSON
{
"sid": "push",
"fields": {
"title": "Welcome",
"body": "Hello, world!",
"icon": "https://example.com/images/icon.jpg",
"click_url": "https://example.com",
"custom_push_json_raw": "{}"
}
}
Description
Parameter | Type | Example | Description |
---|---|---|---|
title | string | "Welcome" | Notification title |
body | string | "Hello, world!" | Notification text |
icon | string | "https://example.com/images/test.jpg" | URL where the notification icon is located |
click_url | string | "https://example.com" | Click-to-go link |
custom_push_json_raw | string | "{}" | Custom JSON to send to mobile push |
Notify fields
- JSON
- XML
{
"sid": "notify",
"fields": {
"template": {
"id": 1,
"name": "message_after_purchase",
"type": "NOTIFY",
"status": "NOT_SENT",
"is_draft": true,
"edna_account_id": "",
"notify_service_name": "altcraft_testing",
"vk_data": {
"body": "Notify message content",
"buttons": [],
"attachments": [],
"enabled": true,
"inline_keyboard": false,
"hide_keyboard": false,
"reply_enabled": false
},
"ok_data": {
"enabled": true,
"body": "Notify message content"
},
"sms_data": {
"enabled": true,
"body": "Notify message content",
"type": "advert"
},
"routes": [
{
"route": "vk",
"deliv_timeout": 86400,
"read_timeout": 86400
},
{
"route": "ok",
"deliv_timeout": 86400,
"read_timeout": 86400
},
{
"route": "sms"
}
]
},
"info": {
"is_obsolete": false,
"not_found": false
},
"params": {
"name": "{{$.Lead._fname}}",
"order_number": "{{$.Lead.order_number}}"
}
}
}
<xml>
<sid>notify</sid>
<fields>
<info>
<is_obsolete>false</is_obsolete>
<not_found>false</not_found>
</info>
<params>
<name>{{$.Lead._fname}}</name>
<order_number>{{$.Lead.order_number}}</order_number>
</params>
<template>
<edna_account_id/>
<id>1</id>
<is_draft>true</is_draft>
<name>message_after_purchase</name>
<notify_service_name>altcraft_testing</notify_service_name>
<ok_data>
<body>Notify message content</body>
<enabled>true</enabled>
</ok_data>
<routes>
<deliv_timeout>86400</deliv_timeout>
<read_timeout>86400</read_timeout>
<route>vk</route>
</routes>
<routes>
<deliv_timeout>86400</deliv_timeout>
<read_timeout>86400</read_timeout>
<route>ok</route>
</routes>
<routes>
<route>sms</route>
</routes>
<sms_data>
<body>Notify message content</body>
<enabled>true</enabled>
<type>advert</type>
</sms_data>
<status>NOT_SENT</status>
<type>NOTIFY</type>
<vk_data>
<attachments/>
<body>Notify message content</body>
<buttons/>
<enabled>true</enabled>
<hide_keyboard>false</hide_keyboard>
<inline_keyboard>false</inline_keyboard>
<reply_enabled>false</reply_enabled>
</vk_data>
</template>
</fields>
</xml>
Description
Parameter | Type | Example | Description |
---|---|---|---|
name | string | "message_after_purchase" | Template name |
type | string | "NOTIFY" | Template type |
status | string | "NOT_SENT" | Sending status of the template |
is_draft | boolean | true | Indicates if the template is a draft |
edna_account_id | string | "123456" | Edna account ID |
notify_service_name | string | "altcraft_testing" | Name of the notification service |
body | string | "Notify message content" | VK message body |
buttons | array | [] | VK message buttons |
attachments | array | [] | VK message attachments |
enabled | boolean | true | Whether VK message is enabled |
inline_keyboard | boolean | false | Whether VK inline keyboard is used |
hide_keyboard | boolean | false | Whether VK keyboard should be hidden |
reply_enabled | boolean | false | Whether replies to VK message are allowed |
enabled | boolean | true | Whether OK message is enabled |
body | string | "Notify message content" | OK message body |
enabled | boolean | true | Whether SMS message is enabled |
body | string | "Notify message content" | SMS message body |
type | string | "advert" | SMS message type |
route | string | "vk" | Delivery channel |
deliv_timeout | integer | 86400 | Delivery timeout (in seconds) |
read_timeout | integer | 86400 | Read timeout (in seconds) |
route | string | "ok" | Second delivery channel |
route | string | "sms" | Third delivery channel |
is_obsolete | boolean | false | Whether the template is obsolete |
not_found | boolean | false | Whether the template was found |
Telegram fields
- JSON
- XML
{
"sid": "telegram_bot",
"fields": {
"image": {
"attach": [
{
"content": "/9j/bcvb4234hgdffsd45",
"filekey": "678636591824633380762bee",
"name": "example.jpg",
"size": 65101,
"type": "image_path"
}
]
},
"image_caption": "Telegram bot message description",
"markup_style": "HTML"
}
}
<xml>
<sid>telegram_bot</sid>
<fields>
<image>
<attach>
<content>/9j/bcvb4234hgdffsd45</content>
<filekey>678636591824633380762bee</filekey>
<name>example.jpg</name>
<size>65101</size>
<type>image_path</type>
</attach>
</image>
<image_caption>Telegram bot message description</image_caption>
<markup_style>HTML</markup_style>
</fields>
</xml>
Description
Parameter | Type | Example | Description |
---|---|---|---|
legacy_button_link | string | "https://example.com" | Link attached to the button |
legacy_button_name | string | "button1" | Button label |
markdown_type | string | "HTML" | Text formatting type (HTML/Markdown) |
text | string | "example" | Main message text |
content | string | "/9j/bcvb4234hgdffsd45" | File content in binary (base64) |
filekey | string | "678636591824633380762bee" | Unique file identifier |
name | string | "example.jpg" | Name of the attached file |
size | integer | 65101 | File size in bytes |
type | string | "image_path" | Attachment type (e.g., path to file) |
image_caption | string | "Image description" | Caption for the image |
audio_caption | string | "Audio file description" | Caption for the audio file |
video_caption | string | "Video file description" | Caption for the video file |
markup_style | string | "HTML" | Markup style for Telegram (HTML/Markdown) |
Whatsapp fields
- JSON
- XML
{
"id": 9,
"sid": "whatsapp",
"fields": {
"type": "TEMPLATE",
"template": {
"type": "360DIALOG",
"name": "initiate_message_en",
"hsm_external_id": "c466caf6_c340_4d85_8659_6c9685618a9f_en_initiate_message_en",
"language": "en",
"wa_account_id": "+79999999999",
"hsm_hash_sum": "0b7ac0a91b0ba52e961b87c2297d2bd06a3f5bc1",
"is_invalid": false,
"hsm_not_found": false,
"account_not_found": false
},
"raw_hsm": {
"dialog_template": {
"components": [
{
"type": "BODY",
"text": "Hello! Thank you for waiting. I needed some time to clarify the information regarding your request. Could you please let me know when it's convenient for you to discuss the details? 😃"
}
],
"name": "initiate_message_en",
"namespace": "c466caf6_c340_4d85_8659_6c9685618a9f",
"category": "ISSUE_RESOLUTION",
"language": "en",
"rejected_reason": "NONE",
"status": "approved"
},
"edna_template": null
}
}
}
<xml>
<id>9</id>
<sid>whatsapp</sid>
<fields>
<type>TEMPLATE</type>
<template>
<type>360DIALOG</type>
<name>initiate_message_en</name>
<hsm_external_id>c466caf6_c340_4d85_8659_6c9685618a9f_en_initiate_message_en</hsm_external_id>
<language>en</language>
<wa_account_id>+79999999999</wa_account_id>
<hsm_hash_sum>0b7ac0a91b0ba52e961b87c2297d2bd06a3f5bc1</hsm_hash_sum>
<is_invalid>false</is_invalid>
<hsm_not_found>false</hsm_not_found>
<account_not_found>false</account_not_found>
</template>
<raw_hsm>
<dialog_template>
<components>
<component>
<type>BODY</type>
<text>Hello! Thank you for waiting. I needed some time to clarify the information regarding your request. Could you please let me know when it's convenient for you to discuss the details? 😃</text>
</component>
</components>
<name>initiate_message_en</name>
<namespace>c466caf6_c340_4d85_8659_6c9685618a9f</namespace>
<category>ISSUE_RESOLUTION</category>
<language>en</language>
<rejected_reason>NONE</rejected_reason>
<status>approved</status>
</dialog_template>
<edna_template xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</raw_hsm>
</fields>
</xml>
Description
Parameter | Type | Example | Description |
---|---|---|---|
type | string | "360DIALOG" | WhatsApp template type |
name | string | "initiate_message_en" | Template name |
hsm_external_id | string | "c466caf6_c340_4d85_8659_6c9685618a9f_en_initiate_message_en" | External template ID |
language | string | "en" | Template language |
wa_account_id | string | "+79999999999" | WhatsApp account ID |
hsm_hash_sum | string | "0b7ac0a91b0ba52e961b87c2297d2bd06a3f5bc1" | Template hash |
is_invalid | boolean | false | Whether the template is invalid |
hsm_not_found | boolean | false | Whether the HSM template was found |
account_not_found | boolean | false | Whether the account was found |
name (in raw_hsm) | string | "initiate_message_en" | Template name in raw_hsm |
namespace | string | "c466caf6_c340_4d85_8659_6c9685618a9f" | Template namespace |
category | string | "ISSUE_RESOLUTION" | Template category |
status | string | "approved" | Template status (e.g., approved, rejected) |
rejected_reason | string | "NONE" | Reason for template rejection (if any) |
components.type | string | "BODY" | Component type |
components.text | string | "Hello! Thank you for waiting..." | Message body text |
edna_template | string | "null" | Edna template, if present (in this case — not present) |
Viber™ fields
- JSON
- XML
"id": 10,
{
"sid": "viber",
"fields": {
"series": [
{
"type": "TEXT",
"text": "message text"
},
{
"type": "IMAGE",
"image": "/849074172/3/example.jpg"
},
{
"type": "VIDEO",
"thumbnail": "/848985842/3/678632345824633380762bee/example.jpg",
"duration": 6,
"file_size": 2,
"action": "https://example.com/lib/preview/mp4/example.mp4"
},
{
"type": "TEXT_BUTTON",
"text": "Sample text",
"caption": "button text",
"action": "https://example.com"
},
{
"type": "FILE",
"file_type": "pdf",
"file_name": "example.pdf",
"action": "https://www.example.org/testfiles/resources/pdf/example.pdf"
}
]
}
}
<xml>
<id>10</id>
<sid>viber</sid>
<fields>
<series>
<element>
<type>TEXT</type>
<text>message text</text>
</element>
<element>
<type>IMAGE</type>
<image>/849074172/3/example.jpg</image>
</element>
<element>
<type>VIDEO</type>
<thumbnail>/848985842/3/678632345824633380762bee/example.jpg</thumbnail>
<duration>6</duration>
<file_size>2</file_size>
<action>https://example.com/lib/preview/mp4/example.mp4</action>
</element>
<element>
<type>TEXT_BUTTON</type>
<text>Sample text</text>
<caption>button text</caption>
<action>https://example.com</action>
</element>
<element>
<type>FILE</type>
<file_type>pdf</file_type>
<file_name>example.pdf</file_name>
<action>https://www.example.org/testfiles/resources/pdf/example.pdf</action>
</element>
</series>
</fields>
</xml>
Description
Parameter | Type | Example | Description |
---|---|---|---|
type | string | "TEXT" | Type of message element |
text | string | "message text" | Text content of the message |
image | string | "/849074172/3/example.jpg" | Path to the image |
thumbnail | string | "/848985842/3/678632345824633380762bee/example.jpg" | Preview image for the video |
duration | integer | 6 | Video duration in seconds |
file_size | integer | 2 | File size in megabytes |
action | string | "https://example.com/lib/preview/mp4/example.mp4" | Action URL (used for video, button, or file) |
caption | string | "button text" | Caption for the button |
file_type | string | "pdf" | Type of the file (e.g., PDF) |
file_name | string | "example.pdf" | Name of the attached file |
* Viber™ is a trademark of Rakuten Group, Inc. Blocked in the Russian Federation.