Skip to main content

 

 
8x8 Support

Dynamic Campaign API: How to add records to a dynamic campaign

Objective

How to add records to a dynamic campaign using the Dynamic Campaign API

Applies To

  • Contact Center

Procedure

Collect the required Information

  1. Contact Centre Cluster
    • You can extract the cluster information once you log in to Agent Console or Configuration Manager for Contact Center by looking at the URL in your browser
    • Use the cluster URL without the b, for example, use https://vcc-eu9.8x8.com not https://vcc-eu9b.8x8.com
  2. Tenant Name
  3. Data Request Token
    • This can be found in Contact Center Configuration Manager for Contact Center, Integration, API Token

Configuration Manager Integration API Token.png

  1. Campaign Id of the campaign to add records to
    • This can be found in Contact Center Configuration Manager for Contact Center, Campaigns, Campaign Properties

Configuration Manager Campaign Properties General Properties - Campaign Id.png

  1. CRM Customer Id of records to be added to the campaign
    • This can be found in Agent Console, Customers

API Request

Replace sample text with your data

POST https://vcc-cluster.8x8.com/api/tstats/campaigns/campaign-id/customers

Authorization

Basic Auth
Username: Tenant Name
Password: Data Request Token

Body to add a single record

[
    {
        "customer-id": "10000160"
    }
]

Body to add a multiple records

[
    {
        "customer-id": "10000160"
    },
    {
        "customer-id": "10000161"
    }
]

Body to add a single record with a schedule

[
    {
        "customer-id": "10000160",
        "schedule-date-time": "2016-08-29T09:00:00.000Z"
    }
]

Body to add a multiple records with a schedule

[
    {
        "customer-id": "10000160",
        "schedule-date-time": "2016-08-29T09:00:00.000Z"
    },
    {
        "customer-id": "10000161",
        "schedule-date-time": "2016-08-29T09:00:00.000Z"
    }
]

Example 

This example adds the customer record id 10000160 to thr dynamic campaign id 521 for a tenant on the eu9 cluster.

The Authorization headers base64 encoded tenantName:DataRequestToken has been redacted.

Request

curl --location --request POST 'https://vcc-eu9.8x8.com/api/tstats/campaigns/521/customers' \
--header 'Authorization: Basic *********************************' \
--header 'Content-Type: application/json' \
--data-raw '[
    {
        "customer-id": "10000160"
    }
]'

Response

Status: 207 Multi-Status (WebDAV) (RFC 4918)

 [
    {
        "customer-id": "10000160",
        "http-status": "200",
        "message": "Campaign customer added."
    }
]

Additional Information

Identifying the Contact Center CRM customer-id

The CRM "customer-id" used in the dynamic campaign API can be located at the top of the customer's record in Agent Console and is also known as the "account". In the CRM API (wapi) this id the <accountnum> field.

CRM customer-id.png

For more information, see 8x8 Contact Center Dynamic Campaigns.

  • Was this article helpful?