API Reference
Get answer
DME Get answer API
The request to send message to Webhook. You need setting your Webhook in Setting of bot. You send request to FPT.AI then FPT.AI will send result after finish proccess your content via your Webhook.
Example request
curl -X POST \
https://bot.fpt.ai/api/get_answer/ \
-H 'Authorization: Bearer <bot_token>' \
-H 'Content-Type: application/json' \
-d '{
"channel": "api",
"app_code": "<bot code>",
"sender_id": "sender_id_abc",
"type": "text",
"message": {
"content": "<user's question>",
"type": "text"
}
}
'
Example response
HTTP 200 OK
Request
POST https://bot.fpt.ai/api/get_answer/
Parameters
Parameter | Required | Description |
---|---|---|
channel | yes | Always is api |
messages | yes | Message content |
app_code | yes | Bot code |
sender_id | yes | ID of end user |
type | yes | text or payload |
Text Type
Example request
curl -X POST \
https://bot.fpt.ai/api/get_answer/ \
-H 'Authorization: Bearer <bot_token>' \
-H 'Content-Type: application/json' \
-d '{
"channel": "api",
"app_code": "<bot code>",
"sender_id": "sender_id_abc",
"type": "text",
"message": {
"content": "<user's question>",
"type": "text"
}
}
'
Example response
HTTP 200 OK
Parameters
Parameter | Required | Description |
---|---|---|
channel | yes | Always is api |
messages | yes | Message content |
app_code | yes | Bot code |
sender_id | yes | ID of end user |
type | yes | text |
content | yes | Content send to DME |
Payload Type
Example request
curl -X POST \
https://bot.fpt.ai/api/get_answer/ \
-H 'Authorization: Bearer <bot_token>' \
-H 'Content-Type: application/json' \
-d '{
"channel": "api",
"app_code": "<bot code>",
"sender_id": "<sender id>",
"type": "payload",
"message": {
"content": "<Step name>#base64(payload_data)",
"type": "payload"
}
}
'
Example response
HTTP 200 OK
Parameters
Parameter | Required | Description |
---|---|---|
channel | yes | Always is api |
messages | yes | Message content |
app_code | yes | Bot code |
sender_id | yes | ID of end user |
type | yes | payload |
content | yes | Step code |
Response
Returns a JSON message represents the request status.