Here are the parameters used to create a template:
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
name | string | Yes | Template name | |
language | string | Yes | Language code Refer to the “supported language” code section | |
format | string | Yes | Template format | |
header | string | Optional | Message header | |
body | string | Yes | Message body | |
footer | string | Optional | Message footer |
Sample request using CURL:
Sample 1: Create English Template
$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/message_templates \
-H 'Authorization: Bearer [TOKEN]' \
-d "name=template1" \
-d "language=en" \
-d "format=text" \
-d "header=Hi all," \
-d "body=This is a test message" \
-d "footer=Regards"
Sample 2: Create Chinese Template
$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/message_templates \
-H 'Authorization: Bearer [TOKEN]' \
-d "name=template2" \
-d "language=zh_CN" \
-d "format=text" \
-d "header=您好," \
-d "body=这是一则测试版模" \
-d "footer=谢谢"
Sample request using CURL:
Sample 3: Create Emoji Template
$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/message_templates \
-H 'Authorization: Bearer [TOKEN]' \
-d "name=template1" \
-d "language=en" \
-d "format=text" \
-d "header=Hi all," \
-d "body=This is an emoji template 😀 😃 😄 😁 😆 😅 😂 😉 😌 😍 🥰 😘 " \
-d "footer=Regards"
Sample 4: Create Template with Placeholder(s)
$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/message_templates \
-H 'Authorization: Bearer [TOKEN]' \
-d "name=template1" \
-d "language=en" \
-d "format=text" \
-d "header=Hi {{1}}," \
-d "headerExample=["Alice"]," \
-d "body=Nice to meet you, {{1}}.
Welcome to wonderland {{2}}" \
-d "bodyExample=["Alice","Bye"]," \
-d "footer=Regards,"
Parameters returned in the API response:
PARAMETER | FORMAT | DESCRIPTION |
responseCode | string | Response code. Possible values: 0: Success 8: Account Invalid Configuration 88: General Failure 311: WhatsApp Template rejected 312: WhatsApp Template with the same content already existed |
responseMessage | string | Response message |
id | string | Template id |
Sample Response:
{
"responseCode": "0",
"responseMessage": "Success",
"id":"778322986552978"
}