JSON API is an advanced component providing powerful flexibility and functionality. With JSON API, you can connect your bot to a backend service, completing a highly flexible responses.
You can make many kinds of HTTP requests for your bot to analyze your backend and make the appropriate responses.
To be specific, you can run:
Create dynamic messages
Execute “postbacks”
Obtain and set up user arguments (coming soon)
Redirecting to other messages (coming soon)
Response reference:
We will parse the JSON response and send a message to the customer based on the response. For more information, please visit
Sending Text
The response below will be sent as text messages.
{
"messages": [
{ "text": "Welcome to the smartest bot building tool ever —— YOCTOL.AI" },
{ "text": "what kind of bot do you want to build?" }
]
}
Sending Image
Image formats of JPG, PNG and GIF are supported as messages from JSON requests.
The following response will send a voice memo file. Currently, Messenger only supports memo files under 25MB of size with extensions of MP3, OCG, and WAV.
You can also send special buttons for actions, such as dialing a number.
{
"messages": [
{
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [
{
"title": "Learn More",
"image_url": "https://www.yoctol.com/images/amazingBrain.png",
"subtitle": "You can directly contact us! If you like our service, help us to share it to others!",
"buttons": [
{
"type": "phone_number",
"phone_number": "+886223222168",
"title": "Contact service agent"
},
{
"type": "element_share"
}
]
}
]
}
}
}
]
}
Sending Quick Reply
The following response provides a text with quick reply buttons.
{
"messages": [
{
"text": "Did you enjoy the last game of the CF Rockets?",
"quick_replies": [
{
"content_type": "text",
"title": "Loved it!",
"payload": <TEXT PAYLOAD>
}
]
}
]
}
The following response will return a list template message. For more information, visit
The following response will send a button template. You can manually set up the actions for each button, for example prompting to another website. For more usages of buttons, visit