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.
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
Parameter | Data type | Description |
messageMatcher | object | Object with the template data |
name | string | Template name |
channelType | string | Interaction channel type. Possible values are: WHATSAPP , VIBER , SMS |
language | string | Template language |
content | object | Object with the template contents |
category | string | Template category |
type | string | Template 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) |
subjectIds | integer | Array of identifiers of the subjects of the channels for which the template is being created. To retrieve the IDs, use the channel-profile method. |
createdAt | string | Template creation date |
updatedAt | string | Template status change date |
status | string | Template registration status |
locked | boolean | Attribute 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.