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 Available category: – 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 | |
cursorBefore | string | Optional | Page cursor. Previous page | |
cursorAfter | string | Optional | Page cursor. Next page |
Sample request using CURL:
$ curl -X GET "https://api.geniq.io/rest/v1/whatsapp/message_templates?limit=1&category=MARKETING&status=APPROVED" \
-H 'Authorization: Bearer [TOKEN]'
Parameters returned in the API response:
PARAMETER | FORMAT | DESCRIPTION |
responseCode | string | Response code returned from the API call. Refer to section “Response Codes” for list of possible values |
responseMessage | string | Response message returned from the API call |
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"
}
}