WhatsApp

This document describes the API to manage your WhatsApp channels.

API

The base URL for this API is:

https://api.mercury.ai/v1/projects/<projectId>/channels/whatsapp

Register WhatsApp number

WhatsApp channels can be registered with our partner 360 dialog through the user interface in the channel creation dialog. After completing the registration process you get an API-Key that is used to connect your WhatsApp number to your Mercury.ai chatbot.

POST /

{
  "type": "D360",
  "apiKey": "your api key",
  "phoneNumber": "the phone number you registered"
}

The phone number is generally optional but can be used to automatically render QucikReply buttons as https://wa.me/<phoneNumber>?text=<quick reply button text> links where available.

List WhatsApp channels

Lists all WhatsApp channels in you project.

GET /

Returns a WhatsAppChannelModel.

Get channel details

Get details about a specific channel.

GET /<channelId>

Returns a WhatsAppChannelModel.

Update channel details

PATCH /<channelId>

{
  "name": "channel name",
  "description": "description of the channel"
}

Delete channel

DELETE /<channelId>

Deletes your WhatsApp channel and deregisters the inbound webhook.

Models

Json models used by this API.

WhatsAppChannelModel

{
  "channelId": "id of the channel",
  "subtype": "D360",
  "enabled": "<boolean>",
  "name": "name of the channel",
  "description": "description of the channel"
}