Template Messages

A message template is required to start a business-initiated conversation. These messages are stored on a WABA level, so multiple phone numbers in the same WABA can use the same template messages.

Template messages must be submitted to Meta for approval before they are available to use.

Each WhatsApp Business Account can have up to 250 message templates. That means 250 message template names, and each of them can have multiple language translations. For example, a message template called hello_world translated into two languages counts as a single message template in regards to this limit.

Sending a Template Message

Send Template Message

POST https://api.qikchat.in/v1/messages

Request Body

Name
Type
Description

to_contact*

string

customer whatsapp number you want to send message

type*

strng

template

template*

String

contains multiple fields

A successful response includes a data object with an ID for the message sent.

{
    "status": true,
    "message": "Messages queued successfully",
    "data": [
        {
            "id": "52JH6WmuSruAVyXvBBYemd0Ia",
            "channel": "whatsapp",
            "from": "918080808081",
            "recipient": "+918080808080",
            "credits": 0.80,
            "created_at": "2023-02-19T12:52:25.222Z",
            "status": "queued"
        }
    ]
}

Example 1 - Sending Basic Template Message

{
    "to_contact": "+91XXXXX12345",
    "type": "template",
    "template": { 
        "name": "sample_shipping_confirmation",
        "language": "en_US",
        "components": [
            {
                "type": "body",
                "parameters": [
                    {
                        "type": "text",
                        "text": "4"
                    }
                ]
            }
        ]
    }
}

Example 2 - Sending Media Template Message with Parameters

{
    "to_contact": "+91XXXXX12345",
    "type": "template",
    "template": {
        "name": "template_name",
        "language": "en_US",
        "components": [
            {
                "type": "header", # optional
                "parameters": [
                    {
                        "type": "image",
                        "image": {
                            "link": "http(s)://the-url"
                        }
                    } # OR
                    {
                        "type": "video",
                        "video": {
                            "link": "http(s)://the-url"
                        }
                    } # OR
                    {
                        "type": "document",
                        "document": {
                            "link": "http(s)://the-url",
                            "filename": "file-name"
                        }
                    } # OR
                    {
                        "type": "text",
                        "text": "Welcome header text"
                    }
                ] 
            },
            {
                "type": "body",
                "parameters": [
                    {
                        "type": "text",
                        "text": "sample2"
                    }
                ]
            }
        ]
    }
}

Last updated