To retrieve templates, you can use the following parameters as filters.
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
limit | integer | Optional | Limit the total number of results returned | |
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 | |
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: Bearer [TOKEN]' \
-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 | array | Template data. One or many template |
data[0].name | string | Template name |
data[0].language | string | Template language |
data[0].status | string | Template status |
data[0].category | string | Template category |
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",
"language": "en",
"status": "APPROVED",
"category": "UTILITY",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "Hi all,"
},
{
"type": "BODY",
"text": "This is a test message",
"format": "",
},
{
"type": "FOOTER",
"text": "Regards",
"format": "",
}
]
}
],
"paging": {
"cursors": {
"before": "MAZDZD",
"after": "MAZDZD"
}
}