Receiving Template Registration Status

This article covers a callback function that passes information about the changes in a template’s registration status. Callback is a request that passes information to your server. The request parameters are passed in the request body.

URL

To receive callbacks about template registration statuses, in your edna dashboard, go to the Settings tab on Integration page, and in the Callback URL for managing API field, specify your system’s API endpoint that will process incoming POST requests from edna API.

Only the HTTPS protocol is supported.

Example of an Incoming POST Request

{
    "messageMatcher": {
        "name": "new_matcher_2",
        "channelType": "WHATSAPP",
        "language": "EN",
        "content": {
            "header": {
                "headerType": "TEXT",
                "text": "Hello, thank you for choosing us."
            },
            "text": "string",
            "footer": {
                "text": "my footer text"
            }
        },
        "category": "MARKETING",
        "status": "APPROVED",
        "locked": false,
        "type": "OPERATOR",
        "createdAt": "2022-05-05T11:34:34.844Z",
        "updatedAt": "2022-05-05T11:34:34.844Z"
    },
    "subjectIds": [
        18594
    ]
}

Request Parameters

ParameterData typeDescription
messageMatcherobjectObject with the template data
namestringTemplate name
channelTypestringInteraction channel type. Possible values are: WHATSAPP, VIBER, SMS
languagestringTemplate language
contentobjectObject with the template contents
categorystringTemplate category
typestringTemplate type. Possible values are:

 OPERATOR – Operator template (a template that was registered with a service provider)
 USER – User template (a template that was created by a user based on an operator template)
subjectIdsintegerArray of identifiers of the subjects of the channels for which the template is being created. To retrieve the IDs, use the channel-profile method.
createdAtstringTemplate creation date
updatedAtstringTemplate status change date
statusstringTemplate registration status
lockedbooleanAttribute that defines whether the template is blocked. Possible values are:

 TRUE – The template is blocked
 FALSE – The template is active

Template Statuses

The status parameter has the following values:

  • APPROVED — active
    Note that only active templates can be used for broadcasts.
  • REJECTED — rejected by Meta
  • PENDING — pending registration
  • NOT_SENT — unsent draft
  • ARCHIVED — archived by the user
  • PAUSED — paused by Meta
  • DISABLED — disabled by Meta

Response Format

As a response to the request from your server, its status with the code 200 must return.

If the code 200 is not received in response to the callback request, edna Pulse makes 10 more request attempts with an interval of 2*X seconds between attempts (where X is the number of attempts) until the code 200 is received in response. That is, every 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 seconds.