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

Available category:
– 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
cursorBeforestringOptionalPage cursor. Previous page
cursorAfterstringOptionalPage 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:

PARAMETERFORMATDESCRIPTION
responseCodestringResponse code returned from the API call. Refer to section “Response Codes” for list of possible values
responseMessagestringResponse message returned from the API call
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"
        }
    }