1. Home
  2. Docs
  3. WhatsApp
  4. Send WhatsApp Message
  5. WhatsApp Template Message

WhatsApp Template Message

The WhatsApp API supports sending template messages, which are used to initiate chats with your customers. Before sending a template message, you must first create one.

For more information on managing and creating WhatsApp template messages, please refer to our documentation: https://www.geniq.io/docs/whatsapp-messaging/manage-whatsapp-template/

PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
namestringYesTemplate name
languagestringYesTemplate language
headerParamsarrayOptionalParameter(s) that will be used to replace the dynamic field in the message header
bodyParamsarrayOptionalParameter(s) that will be used to replace the dynamic field in the message body

Sample request using CURL:

Sample 1:

$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/messages \
-H 'Authorization: Bearer [TOKEN]' \
-H 'Content-Type: application/json' \
-d '{
    "recipient":"6591234567",                
    "type":"location",
    "name":"template1",
    "language": "en",
    "reference": "12345",
}' \

Sample 2 (With Dynamic Parameter(s)):

$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/messages \
-H 'Authorization: Bearer [TOKEN]' \
-H 'Content-Type: application/json' \
-d '{
    "recipient":"6591234567",                
    "type":"location",
    "name":"template1",
    "headerParams": [
        "Header Param 1"
    ],
    "bodyParams": [
        "Body Param 1",
        "Body Param 2"
    ],
    "language": "en",
    "reference": "12345",
}' \