List of Campaigns

Retrieve a list of Campaign objects

Parameter

Accessible via URL https://api.channel.io/open/v3/mkt/campaigns and HTTP GET

Parameter

Example

Required

Description

Parameter Type

since

1605795977290

Optional

Epoch time in microseconds of the first Campaign to be retrieved.
Pagination is supported along with the next value contained in the root object of the JSON response.

Query

limit

25

Optional

Restrict the maximum number of Campaign objects to be retrieved

  • min : 1
  • max : 500
  • default : 25

Query

states

active (draft, active, stopped)

Optional

A set of Campaign states to be retrieved.

Query

Example

GET https://api.channel.io/open/v3/mkt/campaigns?since=1605795977290&limit=25&states=draft&states=active

Response

Returns a list of Campaign and CampaignMsg objects

{
  "next": 1605163153977,
  "campaigns": [
    {
      "id": "string",
      "channelId": "string",
      "name": "string",
      "state": "draft",
      "userQuery": {
        "key": "string",
        "type": "boolean",
        "operator": {},
        "values": [
          {}
        ],
        "and": [
          null
        ],
        "or": [
          null
        ]
      },
      "triggerEventName": "string",
      "triggerEventQuery": {
        "key": "string",
        "type": "boolean",
        "operator": {},
        "values": [
          {}
        ],
        "and": [
          null
        ],
        "or": [
          null
        ]
      },
      "waitingTime": {
        "seconds": 0,
        "units": [
          {
            "dateBased": true,
            "durationEstimated": true,
            "timeBased": true,
            "duration": {
              "seconds": 0,
              "nano": 0,
              "negative": true,
              "zero": true
            }
          }
        ],
        "nano": 0,
        "negative": true,
        "zero": true
      },
      "filterEventName": "string",
      "filterEventQuery": {
        "key": "string",
        "type": "boolean",
        "operator": {},
        "values": [
          {}
        ],
        "and": [
          null
        ],
        "or": [
          null
        ]
      },
      "filterMatch": "positive",
      "goalEventName": "string",
      "goalEventQuery": {
        "key": "string",
        "type": "boolean",
        "operator": {},
        "values": [
          {}
        ],
        "and": [
          null
        ],
        "or": [
          null
        ]
      },
      "advertising": true,
      "enableSupportBot": true,
      "followingSupportBotId": "string",
      "sendToOfflineUser": true,
      "cooldown": {
        "seconds": 0,
        "units": [
          {
            "dateBased": true,
            "durationEstimated": true,
            "timeBased": true,
            "duration": {
              "seconds": 0,
              "nano": 0,
              "negative": true,
              "zero": true
            }
          }
        ],
        "nano": 0,
        "negative": true,
        "zero": true
      },
      "sendMode": "always",
      "sendTimeRanges": {
        "timeRanges": [
          {
            "dayOfWeeks": [
              "mon"
            ],
            "from": 0,
            "to": 0
          }
        ]
      },
      "startAt": 1605163154184,
      "endAt": 1605163154184,
      "draft": {
        "campaign": {},
        "msgs": [
          {}
        ]
      },
      "createdAt": 1605163154186,
      "updatedAt": 1605163154186,
      "sent": 0,
      "view": 0,
      "goal": 0,
      "click": 0
    }
  ],
  "msgs": [
    {
      "id": "string",
      "campaignId": "string",
      "name": "string",
      "botName": "string",
      "message": {
        "blocks": [
          {
            "type": "bullets",
            "language": "string",
            "value": "string"
          }
        ],
        "buttons": [
          {
            "title": "string",
            "theme": "blue",
            "url": "string"
          }
        ],
        "files": [
          {
            "id": "string",
            "type": "string",
            "name": "string",
            "size": 0,
            "contentType": "string",
            "duration": 0,
            "width": 0,
            "height": 0,
            "orientation": 0,
            "animated": true,
            "bucket": "string",
            "key": "string",
            "previewKey": "string"
          }
        ],
        "webPage": {
          "id": "string",
          "url": "string",
          "title": "string",
          "description": "string",
          "imageUrl": "string",
          "videoUrl": "string",
          "publisher": "string",
          "author": "string",
          "width": 0,
          "height": 0,
          "bucket": "string",
          "previewKey": "string",
          "logo": "string",
          "name": "string"
        }
      },
      "exposureType": "fullScreen",
      "createdAt": 1605163154186,
      "updatedAt": 1605163154186,
      "sent": 0,
      "view": 0,
      "goal": 0,
      "click": 0
    }
  ]
}