Bot-Chattigo ISV
Our API lets ISV (Independent Software Vendor) clients connect to BOT-CHATTIGO and configure personalized responses inside the bot. This solution lets ISVs define the responses they want the bot to deliver to their customers, and provides the data structure needed to send messages directly to WhatsApp, enabling seamless communication.
What’s new
| Capability | Description |
|---|---|
| ISV-BOT connection | The API facilitates the connection between ISVs and BOT-CHATTIGO, enabling fluid interaction. |
| Response configuration | ISVs can configure the responses they want the bot to deliver to their customers. |
| Inbound message handling | ISVs can send inbound WhatsApp messages to our endpoint after a successful login. |
| Custom webhooks | ISVs can set their own webhooks in our database (Chattigo). |
| Message processing | Chattigo processes messages exactly according to the structure that comes from WhatsApp. |
| Response delivery | The API provides the structure to send several message types: templates, text, multimedia, reaction, location, contact and interactive. |
| Flexibility | ISVs can make decisions based on the response and decide how to handle it. |
Authentication
Service to obtain the authentication token used in each iteration. It is valid for 8 hours and only for the logged-in user.
For the messaging service using the WhatsApp Cloud API structure, you must provide a version of it; initially versions 14.0 and 15.0 are used, and new Meta versions will be added over time.
Request
POST /login
curl --request POST \
--url 'https://api.chattigo.com/login' \
--header 'Content-Type: application/json' \
--data '{
"username": "<user>",
"password": "<password>"
}'Response
Success (200)
{
"user": "<user>",
"access": true,
"access_token": "<valid token>"
}Sending messaging to Chattigo
For inbound messages you want to send to Chattigo to be processed by BOT-CHATTIGO, see Meta’s payload documentation.
To send them, make a POST /webhooks/inbound call.
Configure the outbound webhook
The PATCH /webhooks/outbound route adds or changes the endpoint that will receive the responses coming from Chattigo.
Request
PATCH /webhooks/outbound
curl --request PATCH \
--url 'https://api.chattigo.com/webhooks/outbound' \
--header 'Authorization: <JWT>' \
--header 'Content-Type: application/json' \
--data '{
"waId": "<channel identifier>",
"externalWebhookIsvBot": "<secure HTTPS URL>"
}'Object definition:
| Field | Type | Required | Description |
|---|---|---|---|
waId | String | Yes | Channel identifier. |
externalWebhookIsvBot | String | Yes | Client URL for dispatching outbound messages coming from the bot. |
Response
Success (200)
{
"waId": "<channel identifier>",
"externalWebhookIsvBot": "<secure HTTPS URL>"
}Responses you will receive from Chattigo
Templates
For template sending you will receive a payload like the following:
{
"messaging_product": "whatsapp",
"to": "{{Recipient-WA-ID}}",
"type": "template",
"template": {
"name": "hello_world",
"language": {
"code": "en_US"
}
}
}Text
For text message sending you will receive a payload like the following:
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "{{Recipient-Phone-Number}}",
"type": "text",
"text": {
"preview_url": false,
"body": "text-message-content"
}
}Multimedia
In Cloud API, multimedia messaging includes all message types, including stickers and documents.
Image:
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "{{Recipient-Phone-Number}}",
"type": "image",
"image": {
"link": "http(s)://image-url"
}
}Document:
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "{{Recipient-Phone-Number}}",
"type": "document",
"document": {
"link": "http(s)://document-url"
}
}Sticker:
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "{{Recipient-Phone-Number}}",
"type": "sticker",
"sticker": {
"link": "http(s)://sticker-url"
}
}audio, document, image, sticker or video types. In all cases, only the type and the payload key change.In all cases, the successful response is status code 200.
Messaging close notices
When Chattigo conversations finish, a notice like the following will be sent along with the closing response:
{
"chatBeenClosed": {
"closed": true,
"message": "El chat finalizo"
}
}Errors
General errors
Endpoints that require token authorization present the following errors:
| Code | Message |
|---|---|
401 | JWT was invalid (wrong token) |
401 | unauthorized Access (token with insufficient permissions) |
401 | token up for parsing was not passed through the header... (empty token) |
Specific errors
POST /login
| Code | Message |
|---|---|
400 | invalid Password (wrong password) |
400 | unsupported get request. username '<user>' does not exist... (wrong user) |
PATCH /webhooks/inbound
| Code | Message |
|---|---|
400 | unsupported get request. Object with ID 'XXXXXXX' does not exist (wrong waId) |