The JSON API plugin enables you to integrate your backend into your chat bots on Smax bot.
It allows you to
Generate dynamic content
Get and set user attributes
Redirect users to another block in the bot
Create postbacks
You can use GET and POST requests - the max. timeout is always 10 seconds. There are four options to enter data that will be sent with your request:
1. URL — This field supports user attributes, they will be URL-encoded with your request
2. Full JSON profile (POST requests only) — This will send all the user attributes of the user to your backend
In your responses, you can
combine several messages in one answer by sending several dictionaries in the messages array.
use any content type header.
send an empty response to not show the user any dynamic content.
Response Reference
Sending text
Use this response to send text messages.
{
"messages": [
{"text": "Welcome to the Smax Rockets!"},
{"text": "What are you up to?"}
]
}
Sending images
Use this response to send image files. Messenger supports JPG, PNG and GIF images. If you are having issues with GIF rendering, please try to reduce the file size.
Use this response to send a horizontal scrollable gallery. Each item is composed of an image attachment, short description and buttons to request input from the user.
Note: messenger_extensions should only be added if you are using Messenger Extensions.
Use this JSON to add buttons to your responses. You can set buttons to link to a block in the dashboard, open a website, or send another request to your backend. Buttons are limited to 3 items per message.
Do keep in mind that for other functionalities or compiling functions to work altogether is out of Chatfuel's scope of support and we suggest to get help from an expert.
3. JSON Body (POST requests only) — This is a customizable field and will be validated as JSON.
4. URL Encoded (POST requests only) — The data will be encoded before sending your request.