CSML message components all have a matching message format for client use in regular JSON. They can be extended by adding additional properties to the content wrapper.
Text()
1
>Text()
2
{
3
"content":{
4
"text":"message"
5
},
6
"content_type":"text"
7
}
Copied!
Typing()
1
>Typing()
2
{
3
"content":{
4
"duration":1000
5
},
6
"content_type":"typing"
7
}
Copied!
Wait()
1
>Wait()
2
{
3
"content":{
4
"duration":1000
5
},
6
"content_type":"wait"
7
}
Copied!
Url()
1
>Url()
2
{
3
"content":{
4
"url":"https://example.com",
5
"title":"title",
6
"text":"text"
7
},
8
"content_type":"url"
9
}
Copied!
Image()
1
>Image()
2
{
3
"content":{
4
"url":"https://example.com/image.jpg",
5
},
6
"content_type":"image"
7
}
Copied!
Audio()
1
>Audio()
2
{
3
"content":{
4
"url":"https://example.com/audio.mp3",
5
},
6
"content_type":"audio"
7
}
Copied!
Video()
1
>Video()
2
{
3
"content":{
4
"url":"https://example.com/video.mp4",
5
},
6
"content_type":"video"
7
}
Copied!
File()
1
>File()
2
{
3
"content":{
4
"url":"https://example.com/video.mp4",
5
},
6
"content_type":"file"
7
}
Copied!
Button()
1
>Button()
2
{
3
"content":{
4
"title":"Button title",
5
"payload":"Button payload"
6
},
7
"content_type":"button"
8
}
Copied!
Payload()
1
>Payload()
2
{
3
"content":{
4
"payload":"Custom payload"
5
},
6
"content_type":"payload"
7
}
Copied!
Question()
1
>Question()
2
{
3
"content":{
4
"title":"Question",
5
"buttons":[Button]
6
},
7
"content_type":"question"
8
}
Copied!
Child components
Component payloads can be included into one another seamlessly. For example: