Sending Template Messages via the API
First, you need to authorize using a LiveChat token. The most straightforward path is to use PAT (Personal Access Tokens).
Go to Developer Console
Click Tools > Personal Access Tokens > Create new token
Select
chats--access:rw
scope and click Create tokenStore Base64 Encoded Token for authorization.
Now, you can make authorized calls to the API.
Base API URL: https://lwb-api.livechat-integrations.com
Send template message
Once you create the PAT token in the console, please store the Base64 encoded version and add it to the Authorization header like this:
Required headers:
Authorization: Basic {token}
Content-Type: application/json
API Call:
POST /whatsapp-numbers/{id}/template-messages
Note: To receive the number id, you need to email contact@livechat-integrations.com. This will be available in the API at a later date.
Body:
Params | Type | |
to | string | Customer number with country code, without “+” symbol. |
template | Template object | https://developers.facebook.com/docs/whatsapp/on-premises/reference/messages#template-object |
Fetch template messages
Required headers:
Authorization: Basic {token}
API Call:
GET /whatsapp-numbers/{id}/template-messages
Note: To receive the number id, you need to email contact@livechat-integrations.com. This will be available in the API at a later date.