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

Retrieve Template

To retrieve templates, you can use the following parameters as filters.

PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
limitintegerOptionalLimit the total number of results returned
categorystringOptionalTemplate Category
Category list:
UTILITY
AUTHENTICATION 
MARKETING
namestringOptionalThe name for a message template
languagestringOptionalLanguage.
Refer to the “supported language” code section
statusstringOptionalStatus
Possible status:
APPROVED
IN_APPEAL
PENDING
REJECTED
PENDING_DELETION
DELETED
DISABLED
LOCKED
contentstringOptionalThe content for a template
beforestringOptionalPage cursor. Previous page
afterstringOptionalPage 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:

PARAMETERFORMATDESCRIPTION
responseCodestringResponse code. Possible values:
0: Success
8: Account Invalid Configuration
88: General Failure
responseMessagestringResponse message
dataarrayTemplate data. One or many template
data[0].namestringTemplate name
data[0].languagestringTemplate language
data[0].statusstringTemplate status
data[0].categorystringTemplate category
data[0].components[0].typestringTemplate type (Header)
data[0].components[0].formatstringTemplate format (Header)
data[0].components[0].textstringTemplate text (Header)
data[0].components[1].typestringTemplate type (Body)
data[0].components[1].textstringTemplate text (Body)
data[0].components[2].typestringTemplate type (Footer)
data[0].components[2].textstringTemplate text (Footer)
paging.cursors.beforestringPrevious page number
paging.cursors.afterstringNext 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"
        }
    }