This article explains how to send and receive messages through an API and how to listen for messages from a standard webhook on the platform.
Botmaker’s platform provides extensive API documentation that can be used for various purposes. This article focuses exclusively on sending and receiving messages via API. To do this, you'll need to use the messaging API and enable a webhook so that a parallel server can receive messages from the end user.
To access the API, you need to obtain an access token. Follow these steps:
Once logged into the Botmaker platform, go to Botmaker API within the Settings menu.
Select the Integrations option and then select Botmaker API.
Generate a token using the Generate Credentials button or use an existing one.
This token will be used in the header of your API requests.
Messages are sent via the messages
endpoint, specifically send messages
. You can test the API via the Documentation tab.
To do this, select the endpoint in Chat Actions and then the send messages API.
To test, follow these steps:
access-token
field under Authentication.channelId
with the desired channel ID. You can find this ID under the List Channels
endpoint in Channels.contactId
with the contact’s ID. If the conversation is through WhatsApp, this ID will be the customer’s phone number; on Webchat, it’s a generated ID.webhookPayload
field can define additional variables to be sent via webhook notification to your server.You can apply simple formatting to the text of the messages you send to users:
_like this_
.*like this*
.~like this~
.Monospace
: Wrap your message in triple backticks ```like this```
.There are 3 standard API response types:
200
: Successfully sent400
: Body parameter or chat ID error429
: Requests per second limit exceededYou can follow the JSON examples generated directly in the API Documentation tab.
As soon as a user sends a message to your WhatsApp, we forward that message to your webhook. That way, you’ll receive all messages from your users in your own system.
For detailed information on how to manage your webhooks, see the article:
How to Integrate Webhooks?
There are 3 types of webhooks available on the platform:
To receive messages, we use the Message and Status type. The information you receive depends on which data is needed for your operation.
In the configuration screen, you should be able to define the following:
auth-bm-token
.