Skip to main content
Skip table of contents

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).

  1. Go to Developer Console

  2. Click Tools > Personal Access Tokens > Create new token

  3. Select chats--access:rw scope and click Create token

  4. Store 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.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.