Channel object
Used in API requests related to adding and updating message templates.
- JSON
- XML
{
"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"
}
}
<channels>
<sid>email</sid>
<fields>
<text>Hello, world!</text>
<html><html>Hello, world!</html></html>
<subject>Welcome</subject>
</fields>
</channels>
<channels>
<sid>sms</sid>
<fields>
<sms>Hello, world!</sms>
</fields>
</channels>
<channels>
<sid>push</sid>
<fields>
<body>Hello, world!</body>
<click_url>https://example.com</click_url>
<icon>https://example.com/images/picture.jpg</icon>
<title>Welcome</title>
</fields>
</channels>
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
- XML
{
"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
}
}
<xml>
<sid>email</sid>
<fields>
<text>Text version</text>
<html><html>HTML version</html></html>
<subject>Subject line</subject>
<from_email>test@example.com</from_email>
<from_name>Jenny's List</from_name>
<replyto_email>test_reply@example.com</replyto_email>
<replyto_name>Jenny</replyto_name>
<is_not_inline>true</is_not_inline>
</fields>
</xml>
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
- XML
{
"sid": "sms",
"fields": {
"sms": "Содержание SMS сообщения",
"sms_max_count": 0,
"add_sms_url_scheme": true
}
}
<xml>
<sid>sms</sid>
<fields>
<sms>Message content</sms>
<sms_max_count>0</sms_max_count>
<add_sms_url_scheme>true</add_sms_url_scheme>
</fields>
</xml>
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
- XML
{
"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": "{}"
}
}
<xml>
<sid>push</sid>
<fields>
<title>Push notification title</title>
<body>Push notification content</body>
<icon>https://example.com/images/icon.jpg</icon>
<click_url>https://example.com</click_url>
<custom_push_json_raw>{}</custom_push_json_raw>
</fields>
</xml>
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 |