How to create an API chat bot and set up the Hook Url
With an API Chat bot, you would be able to create visually in our builder the main logic. Once is created the bot in builder, in the Channels section, you will set up the Hook Url, where all the events and messages, will be posted.
Create API Chat bot
- Go to the main Dashboard and click "Build a Chatbot", and select "API CHANNEL"
After this, the builder will display. Set a name and save it.
Set the Hook URL
- Go the Channels section and click on API.
- Click on the right side corner "CREATE A NEW CHANNEL"
- A new screen will be displayed,
- Introduce the Channel name, that is private and only for you, you can also change it later
- Introduce the Hook URL, where all the messages and events will be send via POST REQUESTS.
You can have more than one Hook Url:
- Once is done, press CONFIRM
- Once is confirmed an Auth Token gill be generated below:
And also, you will see a new tab called "Linked Bot", press it
- Here is where you will select the API chat bot you created in the Dashboard, bear in mind you can only select an APIchat bot:
Confirm the selection, and that's it.
Here is an example of how the requests will come in case is a message:
For more information please check here: https://dev.landbot.io/chat/index.html#api-Webhooks-PostYour_webhook_url
Send Message to this API Chat bot
Here is an example of the Request needed:
The Auth token needed to send message, is the one generated earlier in the Channel:
The API Platform
In case you want to control other elements of the bot, from variable to assignations, please check here: http://dev.landbot.io/docs/?content=api_platform
In this case this will be the 483663
The Auth token to use the platform API is the one in the Accounts section