Campaign API

Campaign Management

The Campaign API provides access to campaign management functionality, enabling the retrieval of campaign information and the creation of campaign lists for outbound dialing operations.


Get Campaigns

GET /Advanced Dialer/api/Campaign

Retrieves a collection of campaigns. You can filter the results by specific IDs or by a specific Account ID.

Query Parameters

ParameterTypeRequiredDescription
accountIdintegerYesFilter campaigns by the account identifier.
idsstringNoComma-separated list of campaign IDs (e.g., 1,2,3).

Example Request

curl --request GET \
     --url 'https://api.talkdeskapp.com/Advanced Dialer/api/Campaign?accountId=123&ids=1,2,3' \
     --header 'Ocp-Apim-Subscription-Key: YOUR_API_KEY' \
     --header 'accept: application/json'

Response Example

{
  "campaigns": [
    {
      "id": 1,
      "name": "Spring Sales Campaign",
      "accountId": 123,
      "status": "Active",
      "startDate": "2024-03-01T00:00:00Z",
      "endDate": "2024-05-31T23:59:59Z",
      "totalLists": 5,
      "totalRecords": 15000
    }
  ]
}

Get Single Campaign

GET /Advanced Dialer/api/Campaign/{id}

Retrieves detailed information for a specific campaign, including dialing hours and associated lists.

Path Parameters

ParameterTypeDescription
idintegerThe unique identifier of the campaign.

Example Request

curl --request GET \
     --url 'https://api.talkdeskapp.com/Advanced Dialer/api/Campaign/1' \
     --header 'Ocp-Apim-Subscription-Key: YOUR_API_KEY' \
     --header 'accept: application/json'

Get Campaign Lists

GET /Advanced Dialer/api/Campaign/lists

Retrieves all lists associated with a specific campaign, including record counts and completion status.

Query Parameters

ParameterTypeRequiredDescription
campaignIdintegerYesThe ID of the campaign to retrieve lists for.

Example Request

curl --request GET \
     --url 'https://api.talkdeskapp.com/Advanced Dialer/api/Campaign/lists?campaignId=1' \
     --header 'Ocp-Apim-Subscription-Key: YOUR_API_KEY' \
     --header 'accept: application/json'

Create Campaign List

POST /Advanced Dialer/api/Campaign/createlist

Creates a new list within an existing campaign. You can choose to clone default rulesets for the new list.

Request Body

FieldTypeDescription
listNamestringRequired. Name for the new list.
campaignIDintegerRequired. The ID of the campaign to attach the list to.
typestringCategory of the list (e.g., "Prospects").
cloneDefaultRulesetbooleanIf true, applies the campaign's default rules to this list.

Example Request

curl --request POST \
     --url 'https://api.talkdeskapp.com/Advanced Dialer/api/Campaign/createlist' \
     --header 'Content-Type: application/json' \
     --header 'Ocp-Apim-Subscription-Key: YOUR_API_KEY' \
     --data '
{
  "listName": "New Prospects April",
  "campaignID": 1,
  "type": "Prospects",
  "active": true,
  "messageId": 5,
  "cloneDefaultRuleset": true
}'

Response Example

{
  "success": true,
  "listId": 103,
  "message": "List created successfully",
  "list": {
    "id": 103,
    "name": "New Prospects April",
    "campaignId": 1,
    "type": "Prospects",
    "active": true,
    "recordCount": 0,
    "createdDate": "2024-04-01T09:15:00Z"
  }
}