Campaigns API

Endpoints:


Get all campaigns (SMS)

Description: Returns all audiences/ segments within your account.
Endpoint: (GET) /campaigns/:uid

Response body:

{
  "data": [
    {
      "id": "1000",
      "userID": "1002",
      "name": "Test",
      "avatar": "",
      "created": 1588201524,
      "updated": 1588210437,
      "type": "TEXT",
      "isActive": true,
      "archived": true,
      "approved": 0,
      "audiences": [
        "all"
      ],
      "templates": {
        "body": "This is my preview of my super awesome {{brand}} message. \n\nAnother thing is 😍 emojies and macros like: {{loyaltySignupURL}}",
        "scheduled": 1586905489,
        "timezone": "",
        "recurDays": -1,
        "isMMS": true
      },
      "mediaURL": "http://localhost:8081/campaign/media/1002/1000",
      "mediaContentType": "image/jpeg",
      "sendAtTimePredicted": false,
      "lastRun": 0,
      "summary": {
        "msgsSent": 1035021425041826800,
        "msgsErrored": 345007141680608960,
        "msgsReceived": 0,
        "clicks": 1445707579500388000,
        "redemptions": 0,
        "discountRedemptions": 0,
        "unsubscribes": 643250523199744900,
        "convs": 1445707579500388000,
        "uniqueClicks": 1445707579500388000,
        "mmsCost": 0.15121625956751644,
        "smsCost": 0.2855708438656657,
        "uniqueUsers": 6005807097831053000,
        "remainingUsers": 0,
        "totalEligible": 0
      }
    },
  ]
}
FieldTypeDescription
idstringID of campaign
userIDstringUser ID this campaign resides under
namestringName of campaign
avatarstringThe avatar for the campaign
createdepochWhen this campaign was created
updatedepochLast time this campaign was updated
typestringType of campaign “TEXT” is the only value at this moment
isActiveboolWhether or not the campaign is LIVE or PAUSED
archivedboolWhether or not the audience is archived
audiencesarrayAudience ID’s this campaign will send to
templatesobjThe campaigns body message, scheduled start date if any, timezone, if it’s suppose to recur after a certain number of days (-1 = never recur), isMMS (if the sms is sending a media file).
mediaURLstringURL to media for MMS if applicable
mediaContentTypestringContent type for media
sendAtTimePredictedboolWhether or not you want Alpine machine learning to send the message only within 2 hours of the time the persona normally visits the store. Fallback for avg across audiences targeted by campaign.
lastRunepochLast time the SMS campaign was sent
summaryobjAnd object full of stats related to the campaign. Note: “redemptions” is loyalty points redemptions vs “discountRedemptions” which is custom discounts not tied to points.


Close Bitnami banner
Bitnami