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": "Text version",
"html": "<html>HTML версия письма</html>",
"subject": "Тема письма",
"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": "Содержание SMS сообщения",
"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": "Push notification title",
"body": "Push notification content",
"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