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/

For supported language reference:
https://www.geniq.io/docs/whatsapp-messaging/supported-languages/

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
otpstringOptionalThis field is required when sending an Authentication type template

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":"template",
    "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":"template",
    "name":"template1",
    "headerParams": [
        "Header Param 1"
    ],
    "bodyParams": [
        "Body Param 1",
        "Body Param 2"
    ],
    "language": "en",
    "reference": "12345",
}' \

Sample 3 (Authentication Template):

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