CC Managing Campaign Status

How to check and modify the status of a CC Campaign

πŸ“˜

Prerequisites

  • The Campaign MUST be configured as a Dynamic Campaign in Configuration Manager

Authentication

CC Campaign APIs leverage the credentials from the Integration >> API Token area in Configuration Manager.
These APIs use Basic Authentication.
The username will be the "Username" value from this screen, it is generally the tenant name
For read APIs the Data Request Token will the password
For write APIs the Action Request Token will be the password
Authorization :Basic encodedValue
Where encodedValue is base64encode(username:password)

Working with Campaign Status

Status Assignment

RUNNING - Change status to Running from one of the allowed initial states
PAUSED - Change status to Paused from one of the allowed initial states
PURGED - Change status to Purged from one of the allowed initial states
STOPPED - Change status to Stopped from one of the allowed initial states. Stopped is a FINAL STATE

Allowed Campaign Status Changes

No other transitions are allowed, once a campaign is Stopped it cannot be restarted.

1621

Allowed Campaign State Transitions

Get Campaign Status

🚧

URLS vary in this section with an additional 't' in setting campaign status

For Getting the campaign status the url contains stats: /api/stats/campaigns/
For Setting the campaign status the url contains tstats: /api/tstats/campaigns/

Parameters

Method: GET

Headers

NameRequiredDescriptionExample
Authorizationβœ“Basic Authentication where username is the value of username and the password is the value of Data Request Token.Basic bXljbGllbnRJZDpuZXZlcnRlbGxhbnlvbmU=

Path

NameRequiredDescriptionExample
ccPlatformβœ“Contact Center platform can be found in the url when accessing CC Configuration Manager.
North America starts NA
Europe starts EU
Canada starts CA
Asia Pacific starts AP
Australia starts AU
Bell Canada starts BC
Sandbox starts SB
na12
campaignIdβœ“The id of the campaign to get the status for. Can be located in CC Configuration Manager "Campaigns" and adding the "Campaign ID" column, or within a specific campaign as part of "Properties", "General Properties"125

Campaign Status Request

curl --location --request GET 'https://vcc-{ccPlatform}.8x8.com/api/stats/campaigns/{campaignId}.json' \
--header 'Authorization: Basic {encodedValue}'

Campaign Status Response

{
    "campaign": {
        "campaign-name": "My Callbacks",
        "campaign-id": 6561,
        "enabled": "Y",
        "status": 3,
        "no-of-records": 18,
        "caller-id": 13125555068,
        "queue-id": 598,
        "start-time": "",
        "end-time": "",
        "actual-run-time": "2022-10-17T22:31:02+01:00",
        "actual-stop-time": "",
        "daily-start-time": "",
        "daily-end-time": "",
        "retry-interval": 30,
        "max-retry": 1,
        "abandon-max-retry": "",
        "max-ring-time": 15,
        "integration-type": "contactual",
        "calling-window": 2,
        "schedule-name": "'5-6pm Eastern'",
        "timezone": "EST5EST",
        "dynamic-campaign": "Y",
        "sequential": "N"
    }
}

Change Campaign Status

🚧

URLS vary in this section with an additional 't' in setting campaign status

For Getting the campaign status the url contains stats: /api/stats/campaigns/
For Setting the campaign status the url contains tstats: /api/tstats/campaigns/

Parameters

Method: POST

Headers

NameRequiredDescriptionExample
Authorizationβœ“Basic Authentication where username is the value of username and the password is the value of Data Request Token.Basic bXljbGllbnRJZDpuZXZlcnRlbGxhbnlvbmU=

Path

NameRequiredDescriptionExample
ccPlatformβœ“Contact Center platform can be found in the url when accessing CC Configuration Manager.
North America starts NA
Europe starts EU
Canada starts CA
Asia Pacific starts AP
Australia starts AU
Bell Canada starts BC
Sandbox starts SB
na12
campaignIdβœ“The id of the campaign to get the status for. Can be located in CC Configuration Manager "Campaigns" and adding the "Campaign ID" column, or within a specific campaign as part of "Properties", "General Properties"125

Body

NameRequiredDescriptionExample
statusβœ“The status to change the campaign state to: See Status Assignment and Allowed Campaign Status Changes
- RUNNING
- PAUSED
- PURGED
- STOPPED
RUNNING

Change Campaign Status Request

curl --location --request POST 'https://vcc-{ccPlatform}.8x8.com/api/tstats/campaigns/{campaignId}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {encodedValue}'
--data-raw '{
	"status": "RUNNING"
}'

Change Campaign Status Response

{
    "message": "Campaign status changed."
}

References

Campaign Status List

Campaign Status IDDescription
0New
Campaigns that are newly created that have not been started or scheduled.
1Manual Started
Campaigns that have been manually started.
2Scheduled
Campaigns with scheduled start time that have been started but start time has not been reached.
3Manual Running
Campaigns that have been started manually without schedule. These campaigns go into running state right after it is started
4Schedule Running
Campaigns that have reached scheduled start time and successfully run. These campaigns are still in running states.
5Manual Stopped
Campaigns that have been manually stopped by clicking stop button
6Completed (Stopped)
Campaigns have all records completed. These campaigns stopped.
7Schedule Stopped
Campaigns that have been stopped due to scheduled stop time has been reached.
8Manual Paused
Campaigns that have been paused. All the queued records will continue to be processed.
9Schedule Paused
10Manual Purged
Campaigns that have been paused and records that are in the queues have been flushed as appropriate.
11Schedule Purged