Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions
You are not logged in.
I'm trying to integrate a 3rd party AI backend with the bot functionality. My backend returns JSON response that looks like this:
[== JavaScript ==]
{
"msg": "Hi there! What can I help you with today?\n",
"meta_msg": {
"content": {
"quick_replies": [
{
"type": "button",
"content": {
"name": "Raise a new ticket",
"payload": "/raise_ticket"
}
},
{
"type": "button",
"content": {
"name": "Login issues",
"payload": "/cant_login"
}
},
{
"type": "button",
"content": {
"name": "Hardware request",
"payload": "/hardware_request"
}
},
] }}}
I have set up my REST API like so:
And this is my trigger set up for the bot:
But I get this kind of response in the chat:
'
What am I doing wrong?
Offline
You are using two incompatible methods. meta_msg is appended directly to the message received. In order to use this response type.
You just need that your response returned full trigger body like.
[== Undefined ==]
{"response":
[
{
"_id": "q4f24I899",
"type": "text",
"content": {
"text": "some text...",
"quick_replies": [
{
"_id": "xJbl-TMRC",
"type": "button",
"content": {
"name": "Name of second button",
"payload": "first_payload"
}
}
]
}
}
]
}
In rest API definition you put
response just as location response. and in this execute trigger bodu {content_1}
See this sampe.
https://doc.livehelperchat.com/docs/bot/trigger-body
Offline
Thank you for your response. I have configured the AI backend to return JSON in the format you have suggested. But there is still no response being shown, though I have checked and the response is being sent from the backend. Is it a problem with my trigger?
I have even tried to mock the API to return the JSON trigger body example you posted, and I still do not get any response message in the chat.
Offline
If you append simple response text message and if it's not executed means trigger is not executed. If prior that message nothing is shown. Problem with your Rest API integration.
Offline
Also if you followed article you have to return not direct json object in your Rest API but encoded json string.
Offline