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/
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
name | string | Yes | Template name | |
language | string | Yes | Template language | |
headerParams | array | Optional | Parameter(s) that will be used to replace the dynamic field in the message header | |
bodyParams | array | Optional | Parameter(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",
}' \