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 |