Sending messages through a cascade
Use the /api/cascade/schedule method to send messages to WhatsApp and Viber channels.
Messages are sent through a cascade—a scenario for sequential broadcasts to multiple channels. When you register a channel, edna Pulse automatically creates a one-step cascade for it.
You can create a cascade of several channels in your edna Pulse account.
Cascade operation principles How to create a cascadeYou can use the /api/cascade/schedule method to send a message to multiple channels or to a single channel.
Call the method
To call the /api/cascade/schedule method, send a POST request to https://app.edna.io/api/cascade/schedule.
If the request is accepted, the server returns a response with code 200. If request validation fails, the server returns an error code.
The configured webhook receives information about the message delivery result.
Webhook about changing message statusIf the server doesn’t return the message status, contact edna support.
edna Pulse doesn’t allow you to send duplicate messages within 20 minutes after sending a message.
Sending messages through a cascade to different channels
In the request, each channel has its own object: whatsappContent or viberContent.
Request format
The request body includes a set of cascade parameters used to send a message.
{
"requestId": "string",
"cascadeId": number,
"subscriberFilter": {
"address": "string",
"type": "string"
},
"startTime": "string",
"ttl": "string",
"content": {
"whatsappContent": {
...
},
"viberContent": {
...
}
},
"comment": "string",
"priority": "string"
}
Request parameters
General parameters
| Parameter | Data type | Requirement | Description |
|---|---|---|---|
requestId | string | Required | Internal identifier of an outgoing message. The customer's external system generates it. The maximum string length is 256 characters. |
comment | string | Optional | Text comment in the message. The parameter value is displayed in the detailed report. |
cascadeId | number, string is allowed | Required | Cascade identifier. When you create a channel, edna Pulse automatically creates a cascade for sending messages through that channel. To get the cascade identifier, use the API method to retrieve cascade information (the id field).
Receiving cascade information |
subscriberFilter | object | Required | Message recipient: an ID in edna Pulse, the customer's phone number, or other IDs for push messages.
Includes the following parameters: - address — a value that depends on type;
- type — see the type parameter.
For example, if type is PHONE, address is the customer's phone number. |
address | string | Required | Recipient identifier. |
type | string | Required | Recipient identifier type. Possible values are in uppercase:
- INSTAGRAM_ID — A 16-digit identifier of a customer in Instagram. Facebook creates this identifier when the customer first interacts with the business's Instagram account. The value may vary and change for the same Instagram customer.
- FACEBOOK_ID — Customer identifier in Facebook.
- DEVICE_APP_ID — Customer's push device identifier.
- EDNA_ID — Customer identifier in the edna database that edna Pulse automatically creates when you create a customer in edna. Available only for WhatsApp, SMS, and Viber channels. It's displayed on the Edit client page in the URL. For example, 3314 in https://app.edna.io/audience/3314/edit.
- PHONE — Customer's phone number in the 77770000000 format.
- EMAIL
- UTM
- COOKIE_ID
- TELEGRAM_ID
- GOOGLE_ID
- APPLE_ID
- YANDEX_ID
- EXT_USER_ID
- WHATSAPP_BSUID — Business-Scoped User ID (BSUID).
- WHATSAPP_PARENT_BSUID — Parent Business-Scoped User ID (Parent BSUID). |
startTime | string | Optional | Date and time in ISO 8601 format (for example, 2024-07-01T00:00:00Z) before which the message won't be sent. Used for scheduled sending. |
content | object | Required | May contain whatsappContent and viberContent objects.
warning The content must contain at least one object. |
ttl | string | Optional | Time after which the cascade should move to the described step if the message at the previous step wasn't delivered. Specify the time period in ISO 8601 format (for example, PT1M). |
priority | string | Optional | Indicates the message priority.
Possible values: - DEFAULT — standard priority, equivalent to having no additional priority settings;
- LOW — low priority;
- NORMAL — medium priority;
- HIGH — high priority;
- REALTIME — real-time delivery. |
Response format
{
"requestId": "string"
}
Response example
{
"requestId": "test-001"
}
Response parameters
| Parameter | Data type | Description |
|---|---|---|
requestId | string | Internal identifier of an outgoing message. The customer's external system generated it when sending the message. |