Sending Messages by Template ID

To send messages by the template ID templateId, the following methods are used:

  • api/v1/out-messages/whatsapp/template — for sending messages to the WhatsApp channel;
  • api/v1/out-messages/viber/template — for sending messages to the Viber channel.

The api/v1/out-messages/whatsapp/template and api/v1/out-messages/viber/template methods refer to the new API version.

WhatsApp Channel

To send a message to the WhatsApp channel using the `api/v1/out-messages/whatsapp/template` method, send a POST request to the URL `https://app.edna.io/api/v1/out-messages/whatsapp/template `

Request Format

{

"messageId": "string",

"sender": "string",

"phone": "string",

"templateId": integer,

"textVariables": [

"string",

"string",

"string"

],

"buttonVariables": [

"string",

"string"

],

"headerVariables": [

"string"

],

"attachment": {

"url": "string",

"name": "string"

},

"options": {

"comment": "string",

"sendDelay": "string",

"priority": "string"

}

}

Request Example

Text message:

{

"sender": "RETAIL_WA",

"phone": "35700000000",

"templateId": 81,

"options": {

"comment": "2025-08-04T13:00:48.567Z"

}

}

The message with the document in the attachment:

{

"sender": "RETAIL_WA",

"phone": "35700000000",

"templateId": 96,

"attachment": {

"url": "https://tourism.gov.in/sites.pdf",

"name": "example"

},

"options": {

"comment": "promotion"

}

}

A delayed message containing a document in an attachment, variables in the header, message text, and dynamic link buttons:

{

"messageId": "01987f4a-069e-730e-bf59-cedc1e63349",

"sender": "RETAIL_WA",

"phone": "35700000000",

"templateId": 98,

"textVariables": [

"Alex",

"10.05",

"Happy Birthday"

],

"buttonVariables": [

"3FgSD",

"KNsr6"

],

"headerVariables": [

"Good Morning"

],

"attachment": {

"url": "https://tourism.gov.in/sites.pdf",

"name": "offer"

},

"options": {

"comment": "2025-08-15T12:12:16.984Z",

"sendDelay": "PT10H15M47S",

"priority": "NORMAL"

}

}

Request Parameters

ParameterData typeCharacterDescription
`messageId`stringOptionalThe internal ID of the message.
`sender`stringRequiredThe name of the signature.

To find out the name of the signature, use the API method to get a list of channels — the ‘subject` parameter.

Receiving List of Channels
`phone`stringRequiredRecipient’s address (a phone number).

To find out the recipient’s address, use the API method for requesting recipient data — the `addresses.address` parameter.

Requesting Client Data
`templateId`integerRequiredThe template ID.

To find out the template ID, use the API method to get a list of templates — the `id` parameter.

Retrieving List of Templates
`textVariables`array of stringsRequired if the template contains variablesThe values of the variables in the message are based on a template.
`buttonVariables`array of stringsRequired if the template has buttons with dynamic linksVariable values for buttons with dynamic links in a template message. A WhatsApp message template can contain up to two link buttons.
`headerVariables`array of stringsRequired if there is a variable in the template headerThe value of the variable in the template message header. The header can contain only one variable.
`attachment`objectOptionalInformation about the attachment.
`attachment.url`stringRequired if the `attachment` parameter is not emptyLink to the attachment: image, file, video or audio.
`attachment.name`stringRequired if the `attachment` parameter is not emptyThe name of the image, file, video, or audio. The maximum length is 70 characters.
`options`objectOptionalIt is used for additional settings for sending messages.
`options.comment`stringOptionalA text comment to the message. The parameter value is displayed in the message report.
`options.sendDelay`stringOptionalThe time interval in the ISO 8601 durations date format (for example, `PT10H15M48S’) before which the message will not be sent. Used for delayed delivery
`options.priority`stringOptionalIt is used to indicate the priority of messages.

Possible values:
– `LOW` — low priority; – `NORMAL’ — average priority, default value;
– `HIGH` — high priority;
– `REALTIME` — real-time delivery.

Response Format

{

"messageId": "string",

"phone": "string"

}

Response Example

{

"messageId": "01987f4a-069e-730e-bf59-cedc1e63349",

"phone": "35700000000"

}

Response Parameters

ParameterData TypeDescription
`messageId`stringThe internal ID of the message.
`phone`stringRecipient’s address (a phone number).

Viber Channel

To send a message to the Viber channel using the api/v1/out-messages/viber/template method, send a POST request to the URL https://app.edna.io/api/v1/out-messages/viber/template

Request Format

{

"messageId": "string",

"sender": "string",

"phone": "string",

"templateId": integer,

"textVariables": [

"string",

"string",

"string"

],

"options": {

"comment": "$isoTimestamp",

"sendDelay": "timeStampPlus2Minutes",

"priority": "NORMAL"

}

}

Request Example

Text message:

{

"sender": "RETAIL_VIBER",

"phone": "35700000000",

"templateId": 32,

"options": {

"comment": "promotion"

}

}

A delayed message containing variables in the text:

{

"messageId": "01987f4a-070e-730e-bf59-cedc1e63350",

"sender": "RETAIL_VIBER",

"phone": "35700000000",

"templateId": 34,

"textVariables": [

"Alex",

"10.05",

"Happy Birthday"

],

"options": {

"comment": "2025-08-12T12:17:20.981Z",

"sendDelay": "PT1H3M4S",

"priority": "NORMAL"

}

}

Request Parameters

ParameterData typeCharacterDescription
`messageId`stringOptionalThe internal ID of the message.
`sender`stringRequiredThe name of the signature.

To find out the name of the signature, use the API method to get a list of channels — the ‘subject` parameter.

Receiving List of Channels
`phone`stringRequiredRecipient’s address (a phone number).

To find out the recipient’s address, use the API method for requesting recipient data — the `addresses.address` parameter.

Requesting Client Data
`templateId`integerRequiredThe template ID.

To find out the template ID, use the API method to get a list of templates — the `id` parameter.

Retrieving List of Templates
`textVariables`array of stringsRequired if the template contains variablesThe values of the variables in the message are based on a template.
`options`objectOptionalIt is used for additional settings for sending messages.
`options.comment`stringOptionalA text comment to the message. The parameter value is displayed in the message report.
`options.sendDelay`stringOptionalThe time interval in the ISO 8601 durations date format (for example, `PT10H15M48S’) before which the message will not be sent. Used for delayed delivery
`options.priority`stringOptionalIt is used to indicate the priority of messages.

Possible values:
– `LOW` — low priority; – `NORMAL’ — average priority, default value;
– `HIGH` — high priority;
– `REALTIME` — real-time delivery.

Response Format

{

"messageId": "string",

"phone": "string"

}

Response Example

{

"messageId": "01987f4a-069e-730e-bf59-cedc1e63349",

"phone": "35700000000"

}

Response Parameters

ParameterData TypeDescription
`messageId`stringThe internal ID of the message.
`phone`stringRecipient’s address (a phone number).