Message with Styled Sidebar

The sidebar which has a default color of blue can be changed to any Hex color code.

In order to style the sidebar, the parent object in the body array must be of type section. Inside the sections array you can add your message type.

To see the style options reference the

Full JSON Schemabelow.

Example

Example

Example’s JSON

{
"head": {
"text": "I am a header",
"sub_head": {
"text": "I am a sub header"
}
},
"body": [
{
"type": "section",
"sidebar_color": "#bada33",
"sections": [
{
"type": "message",
"text": "I am a message"
}
]
}
]
}

Full JSON Schema

{
"type": "object",
"properties": {
"head": {
"type": "object",
"required": [
"text"
],
"properties": {
"text": {
"type": "string"
},
"style": {
"type": "object",
"properties": {
"color": {
"type": "string",
"format": "Hex"
},
"bold": {
"type": "boolean"
},
"italic": {
"type": "boolean"
}
}
},
"sub_head": {
"type": "object",
"required": [
"text"
],
"properties": {
"text": {
"type": "string"
},
"style": {
"type": "object",
"properties": {
"color": {
"type": "string",
"format": "Hex"
},
"bold": {
"type": "boolean"
},
"italic": {
"type": "boolean"
}
}
}
}
}
}
},
"body": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"sections"
],
"properties": {
"type": {
"type": "string",
"enum": [
"section"
]
},
"sidebar_color": {
"type": "string",
"format": "Hex"
},
"sections": {
"type": "array",
"items": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"message",
"actions",
"fields",
"select",
"attachments"
]
}
}
}
}
}
}
}
}
}

Need help?

If you're looking for help, try Developer Support or our Developer Forum. Priority support is also available with Premier Developer Support plans.