API URL Endpoint:
https://api.geniq.io/rest/v1/whatsapp/message_templates
Create Template Parameters
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
name | string | Yes | Template name | |
language | string | Yes | Language code Refer to the supported language code section: https://www.geniq.io/docs/whatsapp-messaging/supported-languages/ | |
type | string | Yes | Template type | |
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: Basic dXNlcjE6cGFzczE=' \
-d "name=template1" \
-d "language=en" \
-d "type=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: Basic dXNlcjE6cGFzczE=' \
-d "name=template2" \
-d "language=zh_CN" \
-d "type=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: Basic dXNlcjE6cGFzczE=' \
-d "name=template1" \
-d "language=en" \
-d "type=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: Basic dXNlcjE6cGFzczE=' \
-d "name=template1" \
-d "language=en" \
-d "type=text" \
-d "header=Hi {{1}}," \
-d "body=Nice to meet you, {{1}}.
Welcome to wonderland {{2}}" \
-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 same content already existed |
responseMessage | string | Response message |
id | string | Template id |
Sample Response:
{
"responseCode": "0",
"responseMessage": "Success",
"id":"778322986552978"
}
Retrieve Template(s)
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
limit | integer | Optional | Limit the total number of result return | |
category | string | Optional | Template Category Category list: – UTILITY – AUTHENTICATION – MARKETING | |
name | string | Optional | The name for a message template | |
language | string | Optional | Language. Refer to the supported language code section. https://www.geniq.io/docs/whatsapp-messaging/supported-languages/ | |
status | string | Optional | Status Possible status: – APPROVED – IN_APPEAL – PENDING – REJECTED – PENDING_DELETION – DELETED – DISABLED – LOCKED | |
content | string | Optional | The content for a template | |
before | string | Optional | Page cursor. Previous page. | |
after | string | Optional | Page cursor. Next page. |
Sample request using CURL:
$ curl -X GET https://api.geniq.io/rest/v1/whatsapp/message_templates \
-H 'Authorization: Basic dXNlcjE6cGFzczE=' \
-d "limit=1" \
-d "category=UTILITY" \
-d "status=APPROVED"
Parameters returned in the API response:
PARAMETER | FORMAT | DESCRIPTION |
responseCode | string | Response code. Possible values: 0: Success 8: Account Invalid Configuration 88: General Failure |
responseMessage | string | Response message |
data[0].name | string | Template name |
data[0].components[0].type | string | Template type (Header) |
data[0].components[0].format | string | Template format (Header) |
data[0].components[0].text | string | Template text (Header) |
data[0].components[1].type | string | Template type (Body) |
data[0].components[1].text | string | Template text (Body) |
data[0].components[2].type | string | Template type (Footer) |
data[0].components[2].text | string | Template text (Footer) |
paging.cursors.before | string | Previous page number |
paging.cursors.after | string | Next page number |
Sample Response:
{
"responseCode": "0",
"responseMessage": "Success",
"data": [
{
"name": "template1",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Hi all,"
},
{
"type": "BODY",
"text": "This is a test message"
},
{
"type": "FOOTER",
"text": "Regards"
}
],
"language": "en",
"status": "APPROVED",
"category": "TRANSACTIONAL",
"id": "778322986552978"
}
],
"paging": {
"cursors": {
"before": "MAZDZD",
"after": "MAZDZD"
}
}
}
Delete Template
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
name | string | Yes | Template name | |
id | string | Optional | Template id |
Sample request using CURL:
$ curl -X DELETE https://api.geniq.io/rest/v1/whatsapp/message_templates \
-H 'Authorization: Basic dXNlcjE6cGFzczE=' \
-d "name=template1"
Parameters returned in the API response:
PARAMETER | FORMAT | DESCRIPTION |
responseCode | string | Response code. Possible values: 0: Success 8: Account Invalid Configuration 88: General Failure |
responseMessage | string | Response message |
Sample Response:
{
"responseCode": "0",
"responseMessage": "Success",
"id":"778322986552978"
}