Create a campaign

Create a new campaign.

Resource URL:

POST https://api.essential.to/v2/account/campaigns/

Resource information:

Response formatJSON
Requires authentication?Yes

Parameters:

channel_sid
required

SID of the channel on which the campaign should be sent.

name
required

Campaign name, which must be unique to the channel.

body
optional

The message body for the campaign. The body can levarage Message Templates for subscriber specific messaging.

external_ref_id
optional

Optional string to help correlate campaigns with other systems.

tag_expression
required

Escaped JSON describing a tag expression which, when evaluated, enumerates a collection of subscribers. The system will only send the message to each recipient only once, even if they're a member of multiple target groups. See the Tag Expression documentation for more information. NOTE - if you create a complex Tag Expression via the API - the UI will not understand it, and if you update from the UI, it can overwrite and change the expression. The UI assumes the left branch is the includes, and the right to be the excludes. Given that restiction, it is considered an "experts only" mode.

media_urls
optional

Optional collection of URLs pointing to media. These will be sent with the campaign message.

send_at
optional

Optional time at which campaign should be sent. If this value is not provided, the campaign will not be sent.

send_to_inboxed
optional

Optional flag indicating whether campaign messages should be sent to subscribers in the support queue (added_to_inbox_at != null). Default is true.

Sample code:

curl -X POST \
     -u '[SID]:[TOKEN]' \
     -H 'Content-Type: application/json' \
     'https://api.essential.to/v2/account/campaigns' \
     -d '{"channel_sid":"sRhvpNDGZwyDeH-YRZIr9A", "name":"Test Campaign", "body": "This is the body of the test campaign", "tag_expression": "{\"tag_sids\":[\"os1hkFk7eZMe6XHAcRKOKg\"],\"left\":null,\"right\":null,\"operator\":\"UNION\"}" }'

# Sample response
{
  "name": "Test Campaign",
  "external_ref_id": null,
  "send_at": null,
  "status": "unscheduled",
  "body": "This is the body of the test campaign",
  "media_urls": null,
  "created_at": "2017-02-21T21:00:00.145Z",
  "updated_at": "2017-02-21T21:00:00.145Z",
  "sid": "YIoAc9B2eV_L0gOz8uz--w",
  "account_sid": "XsbrYCSo2m0sShMLOlZqtw",
  "channel_sid": "sRhvpNDGZwyDeH-YRZIr9A",
  "tag_expression": {
    "tag_sids": null,
    "left": null,
    "operator": "UNION",
    "right": null
  },
  "send_to_inboxed": true,
  "results": [
  ]
}
Python coming soon.
Node coming soon.