Skip to main content

Channel object

Used in API requests related to adding and updating message templates.

{
"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

ParameterTypeExampleDescription
sidstring"email"
"sms"
"push"
"telegram_bot"
"telegram_group"
"custom_channel"
Channel name
fieldsobject
"fields":{
   "text": "Hello, world",
   "html": "Hello, world!",
   "subject": "Welcome"
}
Template settings for a certain channel

Fields object

Each channel object contains a fields object:

Email fields

{
"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

ParameterTypeExampleDescription
textstring"Hello, world!"Text version of the message
htmlstring"<html>Hello, world!</html>"HTML version of the message
is_ampboolfalseIs there an amp version in the template or not
ampstring"<html>Hello, world!</html>"AMP HTML version of the message
subjectstring"Weather alert"Subject line
from_emailstring"test@example.com"Override "from-email"
from_namestring"Jenny's List"Override "from-name"
replyto_emailstring"test_reply@example.com"Override "replyto_email"
replyto_namestring"Jenny"Override "replyto_name"
is_not_inlinebooltrueDo not convert CSS to inline

SMS fields

{
"sid": "sms",
"fields": {
"sms": "Hello, world!",
"sms_max_count": 0,
"add_sms_url_scheme": true
}
}

Description

ParameterTypeExampleDescription
smsstring"Hello, world!"Message text
sms_max_countint0SMS limit
add_sms_url_schemebooltrueAdd "http://" to links

Push fields

{
"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

ParameterTypeExampleDescription
titlestring"Welcome"Notification title
bodystring"Hello, world!"Notification text
iconstring"https://example.com/images/test.jpg"URL where the notification icon is located
click_urlstring"https://example.com"Click-to-go link
custom_push_json_rawstring"{}"Custom JSON to send to mobile push

Notify fields

{
"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}}"
}
}
}

Description

ParameterTypeExampleDescription
namestring"message_after_purchase"Template name
typestring"NOTIFY"Template type
statusstring"NOT_SENT"Sending status of the template
is_draftbooleantrueIndicates if the template is a draft
edna_account_idstring"123456"Edna account ID
notify_service_namestring"altcraft_testing"Name of the notification service
bodystring"Notify message content"VK message body
buttonsarray[]VK message buttons
attachmentsarray[]VK message attachments
enabledbooleantrueWhether VK message is enabled
inline_keyboardbooleanfalseWhether VK inline keyboard is used
hide_keyboardbooleanfalseWhether VK keyboard should be hidden
reply_enabledbooleanfalseWhether replies to VK message are allowed
enabledbooleantrueWhether OK message is enabled
bodystring"Notify message content"OK message body
enabledbooleantrueWhether SMS message is enabled
bodystring"Notify message content"SMS message body
typestring"advert"SMS message type
routestring"vk"Delivery channel
deliv_timeoutinteger86400Delivery timeout (in seconds)
read_timeoutinteger86400Read timeout (in seconds)
routestring"ok"Second delivery channel
routestring"sms"Third delivery channel
is_obsoletebooleanfalseWhether the template is obsolete
not_foundbooleanfalseWhether the template was found

Telegram fields

{
"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"
}
}

Description

ParameterTypeExampleDescription
legacy_button_linkstring"https://example.com"Link attached to the button
legacy_button_namestring"button1"Button label
markdown_typestring"HTML"Text formatting type (HTML/Markdown)
textstring"example"Main message text
contentstring"/9j/bcvb4234hgdffsd45"File content in binary (base64)
filekeystring"678636591824633380762bee"Unique file identifier
namestring"example.jpg"Name of the attached file
sizeinteger65101File size in bytes
typestring"image_path"Attachment type (e.g., path to file)
image_captionstring"Image description"Caption for the image
audio_captionstring"Audio file description"Caption for the audio file
video_captionstring"Video file description"Caption for the video file
markup_stylestring"HTML"Markup style for Telegram (HTML/Markdown)

Whatsapp fields

{
"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
}
}
}

Description

ParameterTypeExampleDescription
typestring"360DIALOG"WhatsApp template type
namestring"initiate_message_en"Template name
hsm_external_idstring"c466caf6_c340_4d85_8659_6c9685618a9f_en_initiate_message_en"External template ID
languagestring"en"Template language
wa_account_idstring"+79999999999"WhatsApp account ID
hsm_hash_sumstring"0b7ac0a91b0ba52e961b87c2297d2bd06a3f5bc1"Template hash
is_invalidbooleanfalseWhether the template is invalid
hsm_not_foundbooleanfalseWhether the HSM template was found
account_not_foundbooleanfalseWhether the account was found
name (in raw_hsm)string"initiate_message_en"Template name in raw_hsm
namespacestring"c466caf6_c340_4d85_8659_6c9685618a9f"Template namespace
categorystring"ISSUE_RESOLUTION"Template category
statusstring"approved"Template status (e.g., approved, rejected)
rejected_reasonstring"NONE"Reason for template rejection (if any)
components.typestring"BODY"Component type
components.textstring"Hello! Thank you for waiting..."Message body text
edna_templatestring"null"Edna template, if present (in this case — not present)

Viber™ fields

"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"
}
]
}
}

Description

ParameterTypeExampleDescription
typestring"TEXT"Type of message element
textstring"message text"Text content of the message
imagestring"/849074172/3/example.jpg"Path to the image
thumbnailstring"/848985842/3/678632345824633380762bee/example.jpg"Preview image for the video
durationinteger6Video duration in seconds
file_sizeinteger2File size in megabytes
actionstring"https://example.com/lib/preview/mp4/example.mp4"Action URL (used for video, button, or file)
captionstring"button text"Caption for the button
file_typestring"pdf"Type of the file (e.g., PDF)
file_namestring"example.pdf"Name of the attached file

* Viber™ is a trademark of Rakuten Group, Inc. Blocked in the Russian Federation.