Retrieving Events That Trigger Automatic Broadcasts

Use the event-controller method to retrieve an event that triggers sending a broadcast to the specified client at a scheduled time.

URL

To retrieve an event that triggers sending a broadcast, you need to send a POST request to the following URL address: POST /api/event/schedule/

Example

{
    "name": "NY Broadcast",
    "type": "Completed order",
    "version": "1",
    "subscriberFilter": {
        "address": "79000000000",
        "type": "PHONE"
    },
    "data": {
        "additionalProp1": {
            "prop 1"
        },
        "additionalProp2": {
            "prop 2"
        },
        "additionalProp3": {
            "prop 3"
        }
    },
    "startTime": "2021-12-01T13:59:17.511Z"
}

Request Format

ParameterData typeDescription
namestringEvent name in free form
typestringEvent type (for example, “completed order”, “scheduling appointment”, etc.)
versionstringEvent version
subscriberFilterobjectRecipient of the message: a client’s ID in edna Pulse, their phone number, or ID in Instagram

subscriberFilter consists of the following parameters: address and type. Consequently, type can be ID, PHONE, and INSTAGRAM_ID, and address is the value depending on the type (so, for example, if type is PHONE, address will be the client’s phone number). Example:

"subscriberFilter":
{
"address": "79000000000",
"type": "PHONE"
},
addressstringValue depending on type
typestringType of the client’s identifier: ID, PHONE, or INSTAGRAM_ID
IDstringClient’s identifier in edna Pulse database. It is generated automatically when you create/upload a client to the system. The identifier is displayed in the URL on the Edit client page, for example, 3314 in https://app.edna.io/audience/3314/edit
PHONEstringClient’s phone number
INSTAGRAM_IDstringClient’s 16-digit identifier in Instagram. It is generated automatically by Meta when the client contacts the company’s Instagram business account. The value can be different and can change for the same Instagram client.
datastringEvent data in free form
additionalPropstringEvent attribute in free form
startTimestringThe time when the event is scheduled to be processed by edna; displays in the ISO 8601 format. For example, if you enter the time that is an hour later than the current time, edna will save the event immediately but will only process it at the time you specify.

Response Format

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