Triggered (Drip) Campaigns

Triggered (drip) Message Campaigns

Triggered campaigns aims to group similar messages sharing the same message template so that aggregated statistics for campaign can be tracked without overflow in message history.

Triggered campaigns works in 2 steps, first a triggered campaign should be created, then triggered campaign is sent by adding recipients.

To setup a triggered campaign one should make a post call to

POST https://api.cm.com/messages/v1/accounts/{accountId}/messages

Example request body is like follows;

{
    "body": "Hi {{1}} this is a triggered campaign",
    "channels": [
        "SMS"
    ],
    "ignoreUnsubscribes": true,
    "name": "Trigger test",
    "senders": [
        "Trigger"
    ],
    "status": "triggered"
}

You will get a response like follows

{
    "id": "67606cee-b8a9-4d28-988b-db6e73b21c81", // => this is the triggered campaign id to use when adding recipients
    "isStatsComplete": false,
    "body": "Hi {{1}} this is a triggered campaign",
    "channels": [
        "SMS"
    ],
    "ignoreUnsubscribes": false,
    "name": " Trigger test ",
    "recipients": [],
    "senders": [
        "Trigger"
    ],
    "status": "triggered",
    "createdAtUtc": "2019-10-15T07:27:04.3594636Z",
    "createdBy": "87067157-09e6-4a8e-b2da-06bfc126a8cd",
    "updatedAtUtc": "2019-10-15T07:27:02.0369763Z"
}

To add recipients we have to use our created campaigns trigger endpoint, we need to do a POST call to below endpoint with an array of recipients

https://api.cm.com/messages/v1/accounts/{accountId}/messages/{triggeredCampaignId}/trigger

Request should look like following

[
    {
        "msisdn": "+31627142592",
        "data": {
            "1": "John Doe"
        }
    }
]

You will get a HTTP 200 status with the number of added recipients


Did this page help you?