1. Home
  2. Docs
  3. WhatsApp
  4. Manage WhatsApp Template
  5. Create Template

Create Template

Here are the parameters used to create a template:

PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
namestringYesTemplate name
languagestringYesLanguage code
Refer to the “supported language” code section
formatstringYesTemplate format
headerstringOptionalMessage header
bodystringYesMessage body
footerstringOptionalMessage 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:

PARAMETERFORMATDESCRIPTION
responseCodestringResponse 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
responseMessagestringResponse message
idstringTemplate id

Sample Response:

{
"responseCode": "0",
"responseMessage": "Success",
"id":"778322986552978"
}