API Reference
Types of the message
DME have some types of the message include: Text, Image, Carousel, Form, Quick reply card
Text message
The message send to user.
Formart of message is:
{
"channel": "api",
"app_code": "<bot code>",
"messages": [
{
"type": "text",
"content": {
"text": "Content of message",
"buttons": [
{
"title": "B1",
"payload": "<Step name>#base64(payload_data)"
},
{
"title": "B2",
"url": "https://fpt.ai"
},
{
"title": "B3",
"phone_number": "+84999999999"
}
]
}
}
],
"sender_id": "sender_id_abc"
}
Description
Property | Required | Description |
---|---|---|
channel | yes | Channel of message |
app_code | yes | Bot code |
sender_id | yes | ID of end user |
type | yes | Type of message in this case is 'text' |
content.text | yes | Content of message |
content.buttons | No | Buttons array of message. It can is empty |
content.buttons.title | yes | Text label for button |
content.buttons.payload | no | Step code will jump to |
content.buttons.url | no | URL will open |
content.buttons.phone_number | no | Phone number will call |
Image message
The message is images send to user.
Formart of message is:
{
"channel": "api",
"app_code": "<bot code>",
"messages": [
{
"type": "image",
"content": {
"title": "<title>",
"url": "https://cdn-static-v3.fpt.ai/upload/cca157c89f060dbaa6250da371ca363b/46954f056fcd28e60be401d9354fd68c.png"
}
}
],
"sender_id": "sender_id_abc"
}
Description
Property | Required | Description |
---|---|---|
channel | yes | Channel of message |
app_code | yes | Bot code |
sender_id | yes | ID of end user |
type | yes | Type of message (in this type is 'image') |
content.title | yes | Title of image |
content.url | yes | URL of image |
Carousel message
The message is carousel send to user.
Formart of message is:
{
"channel": "api",
"app_code": "<bot code>",
"messages": [
{
"type": "carousel",
"content": {
"carousel_cards": [
{
"image_url": "<image url>",
"subtitle": "B1 Desc",
"title": "New Carousel",
"buttons": [
{
"title": "B1",
"payload": "<Step name>#base64(payload_data)"
}
],
"item_url": ""
},
{
"image_url": "<image url>",
"subtitle": "B2 Desc",
"title": "New carousel",
"buttons": [
{
"title": "B2",
"payload": "<Step name>#base64(payload_data)"
}
],
"item_url": ""
}
]
}
}
],
"sender_id": "sender_id_abc"
}
Description
Property | Required | Description |
---|---|---|
channel | yes | Channel of message |
app_code | yes | Bot code |
sender_id | yes | ID of end user |
type | yes | Type of message (in this type is 'carousel') |
content.carousel_cards | yes | The array of Carousel cards. |
content.carousel_cards.title | yes | Title of card |
content.carousel_cards.subtitle | yes | Description of card |
content.carousel_cards.button | no | The array of buttons |
content.carousel_cards.item_url | no | The link will open if click on item of carousel |
Form message
The message send to user.
Formart of message is:
{
"channel": "api",
"app_code": "<bot code>",
"messages": [
{
"type": "text",
"content": {
"text": "<content>"
}
}
],
"sender_id": "sender_id_abc"
}
Description
Property | Required | Description |
---|---|---|
channel | yes | Channel of message |
app_code | yes | Bot code |
sender_id | yes | ID of end user |
type | yes | Type of message in this case is 'text' |
content.text | yes | Content of message |
Quick Reply Card message
The message send to user.
Formart of message is:
{
"channel": "api",
"app_code": "<bot code>",
"messages": [
{
"type": "quick_reply",
"content": {
"text": "Content of message",
"buttons": [
{
"title": "B1",
"payload": "<Step name>#base64(payload_data)"
},
{
"title": "B2",
"url": "https://bot.fpt.ai"
},
{
"title": "B3",
"phone_number": "+84999999999"
}
]
}
}
],
"sender_id": "sender_id_abc"
}
Description
Property | Required | Description |
---|---|---|
channel | yes | Channel of message |
app_code | yes | Bot code |
sender_id | yes | ID of end user |
type | yes | Type of message in this case is 'quick_reply' |
content.text | yes | Content of message |
content.buttons | No | Buttons array of message. It can is empty |
content.buttons.title | yes | Text label for button |
content.buttons.payload | no | Step code will jump to |
content.buttons.url | no | URL will open |
content.buttons.phone_number | no | Phone number will call |
Payload data
{
"set_attributes": {
"<variable name 1>": "<value>",
"<variable name 2>": "<value>"
}
}