I have a sample Telegram Bot that I have integrated in my api.ai account. I wanted to display Keyboard buttons just like below but it seems that api.ai is only sending the main text reply to telegram. Any idea how can I achieve on what I have just describe above? Please advise for directions and/or solutions. Thanks!

I have a Fulfilment webhook url that returns this json when my sample Intent is invoked
{
"id": "af681b42-9ced-4f8f-ab0c-0559b210dc1a",
"timestamp": "2016-07-15T01:47:30.896Z",
"result": {
"source": "agent",
"resolvedQuery": "Hello",
"action": "show-main",
"actionIncomplete": false,
"parameters": {},
"contexts": [],
"metadata": {
"intentId": "e477976e-2412-4066-b320-48d7dedd5dfe",
"webhookUsed": "true",
"intentName": "Adobo"
},
"fulfillment": {
"speech": "Hello world!",
"source": "index.php",
"data": {
"chat_id": 1,
"text": "hi there",
"parse_mode": "HTML",
"reply_markup": {
"keyboard": [
"A1",
"A2"
],
"one_time_keyboard": true,
"resize_keyboard": true
}
}
},
"score": 1
},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": "4cb02864-9925-4d4c-a0f1-14dbab44add7"
}
I have added in the json format for reply markup keyboard under "data".
Were you able to send text alone (without the keyboard) before?
I think it's a syntax error. The "keyboard" field is supposed to be an array of arrays. Please try replacing that field with the below snippet.
"reply_markup": {
"keyboard": [
["Day", "Week", "Month"],
["Users", "Retention"],
["sessions", "Events"],
["Back"]
],
"one_time_keyboard": true,
"resize_keyboard": true
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With