Back to top

Voice Campaigns

Registered Numbers

List Operations

Get All
GET/calls/callerid/

Example URI

GET /calls/callerid/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "$_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "client_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "description": "Caller ID.",
    "registered_number": "1112223333",
    "representative_of": "My Organization",
    "signed_by": "Authorized User",
    "registered_on": "2016-08-22T12:05:39.571000"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Add
POST/calls/callerid/

Example URI

POST /calls/callerid/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "description": "Caller ID.",
  "registered_number": "1112223333",
  "representative_of": "My Organization",
  "signed_by": "Authorized User"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "An easy to remember name for the registered number."
    },
    "registered_number": {
      "type": "string",
      "description": "The 10 digit phone number to be used as the registered number while making calls."
    },
    "representative_of": {
      "type": "string",
      "description": "The representative of an organization who has authorized the use of this DID as a registered number."
    },
    "signed_by": {
      "type": "string",
      "description": "The digital signature of the authorized user agreeing to comply with all the rules and regulations as described in the terms and conditions."
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "description": "Caller ID.",
  "registered_number": "1112223333",
  "representative_of": "My Organization",
  "signed_by": "Authorized User",
  "registered_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "description": {
      "type": "string",
      "description": "An easy to remember name for the registered number."
    },
    "registered_number": {
      "type": "string",
      "description": "The 10 digit phone number to be used as the registered number while making calls."
    },
    "representative_of": {
      "type": "string",
      "description": "The representative of an organization who has authorized the use of this DID as a registered number."
    },
    "signed_by": {
      "type": "string",
      "description": "The digital signature of the authorized user agreeing to comply with all the rules and regulations as described in the terms and conditions."
    },
    "registered_on": {
      "type": "string",
      "description": "The date and time in UTC on which this DID was registered."
    }
  }
}

Detail Operations

Get One
GET/calls/callerid/?_id={_id}

Example URI

GET /calls/callerid/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the registered number resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "description": "Caller ID.",
  "registered_number": "1112223333",
  "representative_of": "My Organization",
  "signed_by": "Authorized User"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "An easy to remember name for the registered number."
    },
    "registered_number": {
      "type": "string",
      "description": "The 10 digit phone number to be used as the registered number while making calls."
    },
    "representative_of": {
      "type": "string",
      "description": "The representative of an organization who has authorized the use of this DID as a registered number."
    },
    "signed_by": {
      "type": "string",
      "description": "The digital signature of the authorized user agreeing to comply with all the rules and regulations as described in the terms and conditions."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "description": "Caller ID.",
  "registered_number": "1112223333",
  "representative_of": "My Organization",
  "signed_by": "Authorized User",
  "registered_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "description": {
      "type": "string",
      "description": "An easy to remember name for the registered number."
    },
    "registered_number": {
      "type": "string",
      "description": "The 10 digit phone number to be used as the registered number while making calls."
    },
    "representative_of": {
      "type": "string",
      "description": "The representative of an organization who has authorized the use of this DID as a registered number."
    },
    "signed_by": {
      "type": "string",
      "description": "The digital signature of the authorized user agreeing to comply with all the rules and regulations as described in the terms and conditions."
    },
    "registered_on": {
      "type": "string",
      "description": "The date and time in UTC on which this DID was registered."
    }
  }
}

Update
PUT/calls/callerid/?_id={_id}

Example URI

PUT /calls/callerid/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the registered number resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "description": "Caller ID.",
  "registered_number": "1112223333",
  "representative_of": "My Organization",
  "signed_by": "Authorized User"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "An easy to remember name for the registered number."
    },
    "registered_number": {
      "type": "string",
      "description": "The 10 digit phone number to be used as the registered number while making calls."
    },
    "representative_of": {
      "type": "string",
      "description": "The representative of an organization who has authorized the use of this DID as a registered number."
    },
    "signed_by": {
      "type": "string",
      "description": "The digital signature of the authorized user agreeing to comply with all the rules and regulations as described in the terms and conditions."
    }
  }
}
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Delete
DELETE/calls/callerid/?_id={_id}

Example URI

DELETE /calls/callerid/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the registered number resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Bulk Operations

Bulk Add
POST/calls/callerid/bulk/upload/

FormData Key Reference
signed_by The representative of an organization who has authorized the use of this DID as a registered number.
representative_of The digital signature of the authorized user agreeing to comply with all the rules and regulations as described in the terms and conditions.
uploadfile The CSV file that needs to be processed.

Example URI

POST /calls/callerid/bulk/upload/
Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="signed_by"

Authorized Representative
---BOUNDARY
Content-Disposition: form-data; name="representative_of"

Test Company
---BOUNDARY
Content-Disposition: form-data; name="uploadfile"; filename="your_file.csv"
Content-Type: text/csv

---BOUNDARY
Response  200

Opt-Out

List Operations

Get All
GET/calls/donotcall/

Example URI

GET /calls/donotcall/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "$_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "client_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "dnc_number": "1112223333",
    "date_added": "2016-08-22T12:05:39.571000"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Add
POST/calls/donotcall/

Example URI

POST /calls/donotcall/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "dnc_number": "1112223333"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "dnc_number": {
      "type": "string",
      "description": "The 10 digit phone number that should be added to the blacklist."
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "dnc_number": "1112223333",
  "date_added": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "dnc_number": {
      "type": "string",
      "description": "The 10 digit phone number that should be added to the blacklist."
    },
    "date_added": {
      "type": "string",
      "description": "The date and time in UTC on which this DID was added to the DNC list."
    }
  }
}

Detail Operations

Get One
GET/calls/donotcall/?_id={_id}

Example URI

GET /calls/donotcall/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the DNC number resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "dnc_number": "1112223333",
  "date_added": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "dnc_number": {
      "type": "string",
      "description": "The 10 digit phone number that should be added to the blacklist."
    },
    "date_added": {
      "type": "string",
      "description": "The date and time in UTC on which this DID was added to the DNC list."
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json

Update
PUT/calls/donotcall/?_id={_id}

Example URI

PUT /calls/donotcall/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the DNC number resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "dnc_number": "1112223333"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "dnc_number": {
      "type": "string",
      "description": "The 10 digit phone number that should be added to the blacklist."
    }
  }
}
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Delete
DELETE/calls/donotcall/?_id={_id}

Example URI

DELETE /calls/donotcall/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the DNC number resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Bulk Operations

Bulk Add
POST/calls/donotcall/bulk/update/

FormData Key Reference
csv_file The CSV file that needs to be processed.

Example URI

POST /calls/donotcall/bulk/update/
Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_file.csv"
Content-Type: text/csv

---BOUNDARY
Response  200

Bulk Delete
POST/calls/donotcall/bulk/delete/

FormData Key Reference
csv_file The CSV file that needs to be processed.

Example URI

POST /calls/donotcall/bulk/delete/
Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_file.csv"
Content-Type: text/csv

---BOUNDARY
Response  200

Contact Groups

List Operations

Get All
GET/calls/contacts/

Example URI

GET /calls/contacts/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "$_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "client_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "tag": "My Contact Group",
    "contacts": [
      {
        "name": "John Doe",
        "phone": "1112223333"
      }
    ],
    "created_on": "2016-08-22T12:05:39.571000",
    "modified_on": "2016-08-22T12:05:39.571000"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Add
POST/calls/contacts/

Note: You can only create a contact group using this request. To manage contacts in this group, use the bulk operation endpoints listed below.

Example URI

POST /calls/contacts/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "tag": "My Contact Group"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "tag": {
      "type": "string",
      "description": "A friendly name for your contact group."
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "tag": "My Contact Group",
  "contacts": [
    {
      "name": "John Doe",
      "phone": "1112223333"
    }
  ],
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "tag": {
      "type": "string",
      "description": "A friendly name for your contact group."
    },
    "contacts": {
      "type": "array"
    },
    "created_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was modified."
    }
  }
}

Detail Operations

Get One
GET/calls/contacts/?_id={_id}

Example URI

GET /calls/contacts/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the contact group resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "tag": "My Contact Group",
  "contacts": [
    {
      "name": "John Doe",
      "phone": "1112223333"
    }
  ],
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "tag": {
      "type": "string",
      "description": "A friendly name for your contact group."
    },
    "contacts": {
      "type": "array"
    },
    "created_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was modified."
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json

Update
PUT/calls/contacts/?_id={_id}

Note: You can only update a contact group’s tag using this request. To manage contacts in this group, use the bulk operation endpoints listed below.

Example URI

PUT /calls/contacts/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the contact group resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "tag": "My Contact Group"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "tag": {
      "type": "string",
      "description": "A friendly name for your contact group."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "tag": "My Contact Group",
  "contacts": [
    {
      "name": "John Doe",
      "phone": "1112223333"
    }
  ],
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "tag": {
      "type": "string",
      "description": "A friendly name for your contact group."
    },
    "contacts": {
      "type": "array"
    },
    "created_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was modified."
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json

Delete
DELETE/calls/contacts/?_id={_id}

Example URI

DELETE /calls/contacts/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the contact group resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Bulk Operations

Bulk Replace
POST/calls/contacts/bulk/replace/?_id={_id}

Bulk replace will overwrite ALL contacts in the group with the contacts from your file. This is the recommended approach while dealing with very large contact groups.

Note: The index of the first column starts with zero.

FormData Key Reference
name_index The index of the name column in the CSV file. Note that indexes start from 0.
phone_index The index of the phone number column in the CSV file. Note that indexes start from 0.
csv_file The CSV file that needs to be processed.

Example URI

POST /calls/contacts/bulk/replace/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the contact group resource.

Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="name_index"

0
---BOUNDARY
Content-Disposition: form-data; name="phone_index"

1
---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_file.csv"
Content-Type: text/csv

---BOUNDARY
Response  200

Bulk Update
POST/calls/contacts/bulk/update/?_id={_id}

Bulk update let’s you add or update existing records. The CSV file uploaded should contain the name and 10 digit phone number of the contact. Other fields in the CSV files can be added for your reference. These additional fields will be used while generating reports. The CSV file should contain a header row that identifies the various columns present.

Note: The index of the first column starts with zero.

FormData Key Reference
name_index The index of the name column in the CSV file. Note that indexes start from 0.
phone_index The index of the phone number column in the CSV file. Note that indexes start from 0.
csv_file The CSV file that needs to be processed.

Example URI

POST /calls/contacts/bulk/update/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the contact group resource.

Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="name_index"

0
---BOUNDARY
Content-Disposition: form-data; name="phone_index"

1
---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_file.csv"
Content-Type: text/csv

---BOUNDARY
Response  200

Bulk Delete
POST/calls/contacts/bulk/delete/?_id={_id}

Bulk delete let’s you delete contacts based on their phone numbers.

Note: The index of the first column starts with zero.

FormData Key Reference
phone_index The index of the phone number column in the CSV file. Note that indexes start from 0.
csv_file The CSV file that needs to be processed.

Example URI

POST /calls/contacts/bulk/delete/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the contact group resource.

Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="phone_index"

1
---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_file.csv"
Content-Type: text/csv

---BOUNDARY
Response  200

Audio

List Operations

Get All
GET/calls/audio/

Example URI

GET /calls/audio/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "$_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "client_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "source": "upload",
    "description": "My audio file",
    "duration_in_seconds": 12,
    "created_on": "2016-08-22T12:05:39.571000",
    "modified_on": "2016-08-22T12:05:39.571000"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Add
POST/calls/audio/

Audio files can be added either via uploading or it can be generated by using the TTS option. Depending on the method you choose to add the audio file, the attributes required are different and detailed below.

FormData Key Reference
attributes A JSON string describing the attributes of the resource being added.
wav_file The WAV file that is being uploaded. Required when source is upload.

Note: The required WAV file format is PCM, 8000Hz, 16Bit, Mono

When uploading an audio file:

JSON String Key Reference
description A friendly name for the audio resource.
source Describes the source of the audio resource. When uploading a file use upload.

When using the TTS Option:

JSON String Key Reference
description A friendly name for the audio resource.
source Describes the source of the audio resource. When uploading a file use tts.
prompt The text that needs to be converted to the audio format.
gender The gender of the voice that should be used to create the text. Acceptable values include: male or female.

Example URI

POST /calls/audio/
Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="attributes"

{
    "description": "My audio file",
    "source": "upload"
}
---BOUNDARY
Content-Disposition: form-data; name="wav_file"; filename="your_audio_file.wav"
Content-Type: audio/wav

---BOUNDARY
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "source": "upload",
  "description": "My audio file",
  "duration_in_seconds": 12,
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "source": {
      "type": "string",
      "description": "Represents a resource that was uploaded."
    },
    "description": {
      "type": "string",
      "description": "A friendly name for the audio resource."
    },
    "duration_in_seconds": {
      "type": "number",
      "description": "The length of the audio resource in seconds."
    },
    "created_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was modified."
    }
  }
}

Detail Operations

Get One
GET/calls/audio/?_id={_id}

Example URI

GET /calls/audio/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the audio resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "source": "tts",
  "gender": "male",
  "prompt": "This is a test message.",
  "description": "My audio file",
  "duration_in_seconds": 12,
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "source": {
      "type": "string",
      "description": "Represents a resource that was uploaded."
    },
    "gender": {
      "type": "string",
      "enum": [
        "male",
        "female"
      ],
      "description": "Represents the gender of the voice of audio resource."
    },
    "prompt": {
      "type": "string",
      "description": "Represents the text that was converted to audio."
    },
    "description": {
      "type": "string",
      "description": "A friendly name for the audio resource."
    },
    "duration_in_seconds": {
      "type": "number",
      "description": "The length of the audio resource in seconds."
    },
    "created_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was modified."
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json

Delete
DELETE/calls/audio/?_id={_id}

Note: If the audio resource is being used in an active campaign, you cannot delete it. Attempting to do so will return a 403 Forbidden response.

Example URI

DELETE /calls/audio/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the audio resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Call Results

List Operations

Get All
GET/calls/result/filter/?start_date={start_date}&end_date={end_date}&campaign_id={campaign_id}

Example URI

GET /calls/result/filter/?start_date=2016-08-01&end_date=2016-09-01&campaign_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
start_date
string (required) Example: 2016-08-01

The date of the period from which you want results

end_date
string (required) Example: 2016-09-01

The date of the period until which you want results

campaign_id
string (optional) Example: 57bb010e2cd5264797b017e5

The unique id representing the campaign resource. When specified, results returned will be limited to the campaign.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "$_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "client_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "queue_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "campaign_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "contact": {},
    "campaign_name": "My Campaign",
    "disposition": "ANSWERED_HUMAN_IVR",
    "transfer": true,
    "transfer_disposition: `ANSWERED_HUMAN_IVR`": "",
    "transfer_pickup": "2016-08-22T12:05:39.571000",
    "transfer_hangup": "2016-08-22T12:05:39.571000",
    "start_time": "2016-08-22T12:05:39.571000",
    "end_time": "2016-08-22T12:05:39.571000",
    "pickup": "2016-08-22T12:05:39.571000",
    "hangup": "2016-08-22T12:05:39.571000",
    "phone": "1112223333",
    "caller_id": "1112223333",
    "max_retries": 2,
    "retry": 1,
    "complete": true,
    "status": "completed"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Voice Scripts

List Operations

Get All
GET/administration/agiscriptlist/?user_filter={user_filter}

Example URI

GET /administration/agiscriptlist/?user_filter=True
URI Parameters
HideShow
user_filter
string (optional) Example: True

A flag that when specified, results returned will be limited to the user’s client.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "name": "default",
    "script": "agi://agidev1.ivrtechnology.com/nresponsev3_i13.NewCall",
    "script_type": "default_script"
  }
]

Add Operations

Add
POST/administration/agiscriptlist/

Example URI

POST /administration/agiscriptlist/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "name": "project_44_script",
  "script": "agi://agidev1.ivrtechnology.com:9298/44"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "A user friendly name given to a script."
    },
    "script": {
      "type": "string",
      "description": "The url in which the IVR Flow is located."
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "name": "project_44_script",
  "script": "agi://agidev1.ivrtechnology.com:9298/44",
  "script_type": "custom_script"
}

Update Operations

Update
PUT/administration/agiscriptdetail/?_id={_id}

Example URI

PUT /administration/agiscriptdetail/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the Voice Script resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "name": "project_44_script",
  "script": "agi://agidev1.ivrtechnology.com:9298/44"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "A user friendly name given to a script."
    },
    "script": {
      "type": "string",
      "description": "The url in which the IVR Flow is located."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "name": "project_44_script",
  "script": "agi://agidev1.ivrtechnology.com:9298/44",
  "script_type": "custom_script"
}
Response  404
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Delete Operations

Delete
DELETE/administration/agiscriptdetail/?_id={_id}

Note: You can not delete a Voice Script with the default_script as the script_type, this will result in the request failing.

Example URI

DELETE /administration/agiscriptdetail/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the Voice Script resource.

Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Client

List Operations

Get All
GET/administration/clientlist/

Example URI

GET /administration/clientlist/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "_id": "57bba6fac75dae266c4aee1f",
    "client_name": "Client",
    "project_id": 44,
    "initial_billing": 60,
    "increment_billing": 60,
    "site_id": 1,
    "active": true,
    "max_concurrent_calls": 25,
    "agi_scripts": [
      "57bba6fac75dae266c4aee1f"
    ],
    "is_managed": false
  }
]

Add
POST/administration/clientlist/

Example URI

POST /administration/clientlist/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "client_name": "Client",
  "project_id": 44,
  "initial_billing": 60,
  "increment_billing": 60,
  "site_id": 1,
  "active": true,
  "max_concurrent_calls": 25,
  "agi_scripts": [
    "57bb010e2cd5264797b017e5"
  ],
  "is_managed": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "client_name": {
      "type": "string",
      "description": "A user friendly name given to a Client."
    },
    "project_id": {
      "type": "number",
      "description": "The Compass IML project Id."
    },
    "initial_billing": {
      "type": "number",
      "description": "The Initial Billing for Calls in seconds"
    },
    "increment_billing": {
      "type": "number",
      "description": "The Increment in Billing for Calls in seconds"
    },
    "site_id": {
      "type": "number",
      "description": "Usually 1, this is the site id it should be used for the client"
    },
    "active": {
      "type": "boolean",
      "description": "If the Client is active"
    },
    "max_concurrent_calls": {
      "type": "number",
      "description": "How many calls can the Client have at the same time"
    },
    "agi_scripts": {
      "type": "array",
      "description": "A list of the Voice Scripts available for the specific user"
    },
    "is_managed": {
      "type": "boolean",
      "description": "If the Client is active"
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": "57bba6fac75dae266c4aee1f",
  "client_name": "Client",
  "project_id": 44,
  "initial_billing": 60,
  "increment_billing": 60,
  "site_id": 1,
  "active": true,
  "max_concurrent_calls": 25,
  "agi_scripts": [
    "57bba6fac75dae266c4aee1f"
  ],
  "is_managed": false
}

List Operations

Update
PUT/administration/clientdetail/?_id={_id}

Example URI

PUT /administration/clientdetail/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the Client resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "client_name": "Client",
  "project_id": 44,
  "initial_billing": 60,
  "increment_billing": 60,
  "site_id": 1,
  "active": true,
  "max_concurrent_calls": 25,
  "agi_scripts": [
    "57bb010e2cd5264797b017e5"
  ],
  "is_managed": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "client_name": {
      "type": "string",
      "description": "A user friendly name given to a Client."
    },
    "project_id": {
      "type": "number",
      "description": "The Compass IML project Id."
    },
    "initial_billing": {
      "type": "number",
      "description": "The Initial Billing for Calls in seconds"
    },
    "increment_billing": {
      "type": "number",
      "description": "The Increment in Billing for Calls in seconds"
    },
    "site_id": {
      "type": "number",
      "description": "Usually 1, this is the site id it should be used for the client"
    },
    "active": {
      "type": "boolean",
      "description": "If the Client is active"
    },
    "max_concurrent_calls": {
      "type": "number",
      "description": "How many calls can the Client have at the same time"
    },
    "agi_scripts": {
      "type": "array",
      "description": "A list of the Voice Scripts available for the specific user"
    },
    "is_managed": {
      "type": "boolean",
      "description": "If the Client is active"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": "57bba6fac75dae266c4aee1f",
  "client_name": "Client",
  "project_id": 44,
  "initial_billing": 60,
  "increment_billing": 60,
  "site_id": 1,
  "active": true,
  "max_concurrent_calls": 25,
  "agi_scripts": [
    "57bba6fac75dae266c4aee1f"
  ],
  "is_managed": false
}
Response  404
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Delete
DELETE/administration/clientdetail/?_id={_id}

Example URI

DELETE /administration/clientdetail/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the Client resource.

Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Campaign

List Operations

Get All
GET/calls/campaign/

Example URI

GET /calls/campaign/
Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "$_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "client_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "live_answer": {
      "audio_id": {
        "$oid": "57bb010e2cd5264797b017e5"
      },
      "description": "My Live Audio",
      "offers_transfer": true,
      "transfer_type": "default",
      "transfer_number": "1112223333",
      "offers_opt_out": true,
      "opt_out_type": "default",
      "offers_repeat_message": true,
      "repeat_message_type": "default"
    },
    "has_machine_answer_prompt": true,
    "machine_answer": {
      "audio_id": {
        "$oid": "57bb010e2cd5264797b017e5"
      },
      "description": "My Machine Audio",
      "offers_opt_out": true,
      "opt_out_type": "default",
      "opt_out_number": "1112223333"
    },
    "contact_group_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "name": "My Campaign",
    "type": "asap",
    "days_of_week": [
      "SUNDAY",
      "MONDAY",
      "TUESDAY",
      "WEDNESDAY",
      "THURSDAY",
      "FRIDAY",
      "SATURDAY"
    ],
    "call_start": "09:00",
    "call_end": "17:00",
    "timezone": "EST5EDT",
    "max_concurrent_calls": 1,
    "max_retries": 1,
    "minutes_between_retries": 5,
    "registered_number_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "status": "active",
    "created_on": "2016-08-22T12:05:39.571000",
    "modified_on": "2016-08-22T12:05:39.571000"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Add Default Campaign
POST/calls/campaign/

There are two types of Voice Campaigns, ones that use the Default Voice Script and ones that use a Custom Voice Script, depending on the functionality required.

If you require a Voice Campaign in which you can customize how it should behave, you’ll send the _id of the default script inside the schedule attribute, not sending this field will also count and will allow you to upload or select an existing prompt for your campaign. This prompt can be further customized by offering transfer, opt-out and repeating the prompt message.

The campaign request should be of type multipart/form-data with the following keys:

FormData Key Reference
attributes A JSON string describing the attributes of the campaign being added.
audio_file_live The WAV file that is being uploaded for live answer. Required if the source of the live answer audio file is upload.
audio_file_machine The WAV file that is being uploaded for machine answer. Required if the source of the machine answer audio file is upload.
csv_file The CSV file containing the details of the contact group to whom the calls should be sent out. Required if the type of the contact group is upload.

Note: For any audio file being uploaded, the required WAV file format is PCM, 8000Hz, 16Bit, Mono

The attributes parameter is a JSON string which has the following structure:

{
    "voice_script": {},
    "audio": {
        "live_answer": {},
        "has_machine_answer_prompt": true,
        "machine_answer": {}
    },
    "contact_group": {},
    "schedule": {}
}

The actual parameters for each of the objects in the above structure depend on the type of the audio dialog, contact group and schedule desired. The following tables indicate acceptable values for each of these objects.

The voice_script Object:

JSON String Key Data Type Reference Required When
script $oid object Represents the unique ID of the Voice Script that should be used for this campaign. In this case it will be from the Default Script. Optional

The live_answer Object:

JSON String Key Data Type Reference Required When
description string A friendly name for the audio resource. Always
source string Indicates the type of audio resource being used. Allowed values include: upload, tts, reuse Always
prompt string The actual text that needs to be synthesized to audio for playback. source: tts
gender string The gender of the voice that should be used to synthesize the audio for playback. source: tts
audio_id $oid object The unique ID representing the audio resource. source: reuse
offers_transfer boolean Indicates if the live answer should offer a transfer option Always
transfer_type string Indicates which prompt to play when offering the transfer. Allowed values include: default, custom. When default is passed, the in-built system prompt will be used. When custom is passed, please ensure that your audio file includes the verbiage for offering transfer. offers_transfer: true
transfer_number string The 10 digit DID to which the call should be transferred if the caller chooses. offers_transfer: true
offers_opt_out boolean Indicates whether the system should offer an opt-out to the caller. Always
opt_out_type string Indicates which prompt to play when offering the opt-out. Allowed values include: default, custom. When default is passed, the in-built system prompt will be used. When custom is passed, please ensure that your audio file includes the verbiage for offering opt-out. offers_opt_out: true
offers_repeat_message boolean Indicates whether the system should offer to repeat the prompt to the caller. Always
repeat_message_type string Indicates which prompt to play when offering to repeat the prompt. Allowed values include: default, custom. When default is passed, the in-built system prompt will be used. When custom is passed, please ensure that your audio file includes the verbiage for offering to repeat the prompt. offers_repeat_message: true

Note: The keypress allowed for transfers is always 1. Similarly, the keypress offered for opt-outs is always 9 and * for prompt message repeating.

The machine_answer Object:

JSON String Key Data Type Reference Required When
description string A friendly name for the audio resource. Always
source string Indicates the type of audio resource being used. Allowed values include: upload, tts, reuse Always
prompt string The actual text that needs to be synthesized to audio for playback. source: tts
gender string The gender of the voice that should be used to synthesize the audio for playback. source: tts
audio_id $oid object The unique ID representing the audio resource. source: reuse
offers_opt_out boolean Indicates whether the system should offer an opt-out to the caller. Always
opt_out_type string Indicates which prompt to play when offering the opt-out. Allowed values include: default, custom. When default is passed, the in-built system prompt will be used. When custom is passed, please ensure that your audio file includes the verbiage for offering opt-out. offers_opt_out: true
opt_out_number string The 10 digit DID to which is offered to the caller if the caller chooses to opt-out. offers_opt_out: true

The contact_group Object:

JSON String Key Data Type Reference Required When
type string Indicates the type of contact group resource being used. Allowed values include: upload, reuse Always
name_index number The index of the column in the CSV file which contains the name of the contacts. type: upload
phone_index number The index of the column in the CSV file which contains the phone number of the contacts. type: upload
contact_group_id $oid object The unique ID representing the contact group resource. type: reuse

The schedule Object:

JSON String Key Data Type Reference Required When
name string A friendly name for the campaign resource. Always
type string Indicates the type of scheduling desired for the campaign. Allowed values include: asap, throttle, spread Always
start_date string The start of the date window in which the call can be attempted. The date should be formatted as yyyy-MM-dd. type: asap or type: spread
end_date string The end of the date window in which the call can be attempted. The date should be formatted as yyyy-MM-dd. type: spread
days_of_week array[string] This is an array of string values. Indicates the days of the week on which the calls should be sent out. Allowed values include: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY Always
call_start string The start of the time window in a day in which the call can be attempted. The time should be formatted as HH:mm in 24H format. Always
call_end string The end of the time window in a day in which the call can be attempted. The time should be formatted as HH:mm in 24H format. Always
timezone string Indicates the timezone of the call start and end windows. Allowed values include: EST5EDT, CST6CDT, MST7MDT, PST8PDT Always
max_concurrent_calls number Indicates the maximum simultanous calls that can be made. Allowed values include: 1,2,3,4,5,6,7,8,9,10 Always
max_retries number Indicates the number of retry attempts when the initial attempt is unsuccessful, for e.g., if the disposition was busy. Allowed values include: 1,2 Always
minutes_between_retries number Indicates the number of minutes the system should wait before attempting the retry. Allowed values include: 5, 10, 15, 30, 60, 90, 120 Always
registered_number_id $oid object The unique ID representing the registered number that should be used for the caller id. Always

Example URI

POST /calls/campaign/
Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="attributes"

{
    "voice_script": {
        "script": {
            "$oid": "57bba6fac75dae266c4aee1f"
        },
    },
    "audio": {
        "live_answer": {
            "description": "My Live Audio",
            "source": "upload",
            "offers_transfer": true,
            "transfer_type": "default",
            "transfer_number": "7165551234",
            "offers_opt_out": true,
            "opt_out_type": "default",
            "offers_repeat_message" : true,
            "repeat_message_type" : "default"
        },
        "has_machine_answer_prompt": true,
        "machine_answer": {
            "description": "My Machine Audio",
            "source": "upload",
            "offers_opt_out": true,
            "opt_out_type": "default",
            "opt_out_number": "7165551234"
        }
    },
    "contact_group": {
        "type": "upload",
        "name_index": 1,
        "phone_index": 0
    },
    "schedule": {
        "name": "My Campaign",
        "type": "asap",
        "start_date": "2016-09-08",
        "days_of_week": [
            "THURSDAY"
        ],
        "call_start": "09:00",
        "call_end": "17:00",
        "timezone": "EST5EDT",
        "max_concurrent_calls": 1,
        "max_retries": 1,
        "minutes_between_retries": 5,
        "registered_number_id": {
            "$oid": "57bba6fac75dae266c4aee1f"
        }
    }
}
---BOUNDARY
Content-Disposition: form-data; name="audio_file_live"; filename="your_live_audio_file.wav"
Content-Type: audio/wav

---BOUNDARY
Content-Disposition: form-data; name="audio_file_machine"; filename="your_machine_audio_file.wav"
Content-Type: audio/wav

---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_contacts.csv"
Content-Type: text/csv

---BOUNDARY
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "live_answer": {
    "audio_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "description": "My Live Audio",
    "offers_transfer": true,
    "transfer_type": "default",
    "transfer_number": "1112223333",
    "offers_opt_out": true,
    "opt_out_type": "default",
    "offers_repeat_message": true,
    "repeat_message_type": "default"
  },
  "has_machine_answer_prompt": true,
  "machine_answer": {
    "audio_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "description": "My Machine Audio",
    "offers_opt_out": true,
    "opt_out_type": "default",
    "opt_out_number": "1112223333"
  },
  "contact_group_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "name": "My Campaign",
  "type": "asap",
  "days_of_week": [
    "SUNDAY",
    "MONDAY",
    "TUESDAY",
    "WEDNESDAY",
    "THURSDAY",
    "FRIDAY",
    "SATURDAY"
  ],
  "call_start": "09:00",
  "call_end": "17:00",
  "timezone": "EST5EDT",
  "max_concurrent_calls": 1,
  "max_retries": 1,
  "minutes_between_retries": 5,
  "registered_number_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "status": "active",
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "live_answer": {
      "type": "object",
      "properties": {
        "audio_id": {
          "type": "object",
          "properties": {
            "$oid": {
              "type": "string",
              "description": "Unique id representing the resource."
            }
          },
          "description": "The unique ID representing this resource."
        },
        "description": {
          "type": "string",
          "description": "A friendly name for the audio resource."
        },
        "offers_transfer": {
          "type": "boolean",
          "description": "Indicates if the system should offer transfer for the live answer."
        },
        "transfer_type": {
          "type": "string",
          "enum": [
            "default",
            "custom"
          ],
          "description": "Indicates whether the system should use the built-in prompt to offer transfer or if the prompt provided already includes the verbiage for offering transfer."
        },
        "transfer_number": {
          "type": "string",
          "description": "The phone number to transfer the call to when the caller chooses to transfer."
        },
        "offers_opt_out": {
          "type": "boolean",
          "description": "Indicates if the system should offer opt-out for the live answer."
        },
        "opt_out_type": {
          "type": "string",
          "enum": [
            "default",
            "custom"
          ],
          "description": "Indicates whether the system should use the built-in prompt to offer opt-out or if the prompt provided already includes the verbiage for offering opt-out."
        },
        "offers_repeat_message": {
          "type": "boolean",
          "description": "Indicates if the system should offer to repeat the promtp message for the live answer."
        },
        "repeat_message_type": {
          "type": "string",
          "enum": [
            "default",
            "custom"
          ],
          "description": "Indicates whether the system should use the built-in prompt to offer to repeat the prompt message or if the prompt provided already includes the verbiage for offering to repeat the prompt."
        }
      }
    },
    "has_machine_answer_prompt": {
      "type": "boolean",
      "description": "Indicates if a machine answer prompt is present."
    },
    "machine_answer": {
      "type": "object",
      "properties": {
        "audio_id": {
          "type": "object",
          "properties": {
            "$oid": {
              "type": "string",
              "description": "Unique id representing the resource."
            }
          },
          "description": "The unique ID representing this resource."
        },
        "description": {
          "type": "string",
          "description": "A friendly name for the audio resource."
        },
        "offers_opt_out": {
          "type": "boolean",
          "description": "Indicates if the system should offer opt-out for the live answer."
        },
        "opt_out_type": {
          "type": "string",
          "enum": [
            "default",
            "custom"
          ],
          "description": "Indicates whether the system should use the built-in prompt to offer opt-out or if the prompt provided already includes the verbiage for offering opt-out."
        },
        "opt_out_number": {
          "type": "string",
          "description": "The phone number to play to caller if they want to opt-out."
        }
      }
    },
    "contact_group_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing this resource."
    },
    "name": {
      "type": "string",
      "description": "The name of the campaign."
    },
    "type": {
      "type": "string",
      "enum": [
        "asap",
        "throttle",
        "spread"
      ],
      "description": "Represents the type of campaign."
    },
    "days_of_week": {
      "type": "array",
      "description": "Indicates on what days the calls should be sent out."
    },
    "call_start": {
      "type": "string",
      "description": "The start of the window in which the call can be attempted. The time should be formatted as HH:mm in 24H format."
    },
    "call_end": {
      "type": "string",
      "description": "The end of the window in which the call can be attempted. The time should be formatted as HH:mm in 24H format."
    },
    "timezone": {
      "type": "string",
      "enum": [
        "EST5EDT",
        "CST6CDT",
        "MST7MDT",
        "PST8PDT"
      ],
      "description": "Indicates the timezone of the call start and end windows."
    },
    "max_concurrent_calls": {
      "type": "number",
      "enum": [
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10
      ],
      "description": "Indicates the maximum simultanous calls that can be made."
    },
    "max_retries": {
      "type": "number",
      "enum": [
        1,
        2
      ],
      "description": "Indicates the number of retry attempts when the initial attempt is unsuccessful, for e.g., if the disposition was busy."
    },
    "minutes_between_retries": {
      "type": "number",
      "enum": [
        5,
        10,
        15,
        30,
        60,
        90,
        120
      ],
      "description": "Indicates the number of minutes the system should wait before attempting the retry."
    },
    "registered_number_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number that should be used for the caller id."
    },
    "status": {
      "type": "string",
      "description": "Indicates the status of the campaign."
    },
    "created_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was modified."
    }
  }
}

Add Custom Campaign
POST/calls/campaign/

There are two types of Voice Campaigns, ones that use the Default Voice Script and ones that use a Custom Voice Script, depending on the functionality required.

If you already have a Client Compass Studio Application IVR built you’ll require to provide the correct _id of your Voice Script inside the schedule attribute.

The campaign request should be of type multipart/form-data with the following keys:

Note: The audio attribute unlike when scheduling a Voice Campaign with the default Voice Script, is not required in a Custom Voice Script Scheduled Voice Campaign.

FormData Key Reference
attributes A JSON string describing the attributes of the campaign being added.
csv_file The CSV file containing the details of the contact group to whom the calls should be sent out. Required if the type of the contact group is upload.

The attributes parameter is a JSON string which has the following structure:

{
    "voice_script": {},
    "contact_group": {},
    "schedule": {}
}

The voice_script Object:

JSON String Key Data Type Reference Required When
script $oid object Represents the unique ID of the Voice Script that should be used for this campaign. In this case any from a Custom Script. Always

The contact_group Object:

JSON String Key Data Type Reference Required When
type string Indicates the type of contact group resource being used. Allowed values include: upload, reuse Always
name_index number The index of the column in the CSV file which contains the name of the contacts. type: upload
phone_index number The index of the column in the CSV file which contains the phone number of the contacts. type: upload
contact_group_id $oid object The unique ID representing the contact group resource. type: reuse

Note: When uploading the .csv file, you can send custom data besides the name and phone number of each contact, this data can be accessed in the Studio Application IVR to personalize each call for the contact group. The way to access this data on a Compass Studio IVR is using the syntax {{BROADCASTDATA.contact.<csv_header_field_name>}​}.

The schedule Object:

JSON String Key Data Type Reference Required When
name string A friendly name for the campaign resource. Always
type string Indicates the type of scheduling desired for the campaign. Allowed values include: asap, throttle, spread Always
start_date string The start of the date window in which the call can be attempted. The date should be formatted as yyyy-MM-dd. type: asap or type: spread
end_date string The end of the date window in which the call can be attempted. The date should be formatted as yyyy-MM-dd. type: spread
days_of_week array[string] This is an array of string values. Indicates the days of the week on which the calls should be sent out. Allowed values include: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY Always
call_start string The start of the time window in a day in which the call can be attempted. The time should be formatted as HH:mm in 24H format. Always
call_end string The end of the time window in a day in which the call can be attempted. The time should be formatted as HH:mm in 24H format. Always
timezone string Indicates the timezone of the call start and end windows. Allowed values include: EST5EDT, CST6CDT, MST7MDT, PST8PDT Always
max_concurrent_calls number Indicates the maximum simultanous calls that can be made. Allowed values include: 1,2,3,4,5,6,7,8,9,10 Always
max_retries number Indicates the number of retry attempts when the initial attempt is unsuccessful, for e.g., if the disposition was busy. Allowed values include: 1,2 Always
minutes_between_retries number Indicates the number of minutes the system should wait before attempting the retry. Allowed values include: 5, 10, 15, 30, 60, 90, 120 Always
registered_number_id $oid object The unique ID representing the registered number that should be used for the caller id. Always

Example URI

POST /calls/campaign/
Request
HideShow
Headers
Content-Type: multipart/form-data, boundary=---BOUNDARY
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
---BOUNDARY
Content-Disposition: form-data; name="attributes"

{
    "voice_script": {
        "script": {
            "$oid": "57bba6fac75dae266c4aee1f"
        },
    },
    "contact_group": {
        "type": "upload",
        "name_index": 1,
        "phone_index": 0
    },
    "schedule": {
        "name": "My Campaign",
        "type": "asap",
        "start_date": "2016-09-08",
        "days_of_week": [
            "THURSDAY"
        ],
        "call_start": "09:00",
        "call_end": "17:00",
        "timezone": "EST5EDT",
        "max_concurrent_calls": 1,
        "max_retries": 1,
        "minutes_between_retries": 5,
        "registered_number_id": {
            "$oid": "57bba6fac75dae266c4aee1f"
        }
    }
}

---BOUNDARY
Content-Disposition: form-data; name="csv_file"; filename="your_contacts.csv"
Content-Type: text/csv

---BOUNDARY

Detail Operations

Get One
GET/calls/campaign/?_id={_id}

Example URI

GET /calls/campaign/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the campaign resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "$_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "client_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "live_answer": {
    "audio_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "description": "My Live Audio",
    "offers_transfer": true,
    "transfer_type": "default",
    "transfer_number": "1112223333",
    "offers_opt_out": true,
    "opt_out_type": "default",
    "offers_repeat_message": true,
    "repeat_message_type": "default"
  },
  "has_machine_answer_prompt": true,
  "machine_answer": {
    "audio_id": {
      "$oid": "57bb010e2cd5264797b017e5"
    },
    "description": "My Machine Audio",
    "offers_opt_out": true,
    "opt_out_type": "default",
    "opt_out_number": "1112223333"
  },
  "contact_group_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "name": "My Campaign",
  "type": "asap",
  "days_of_week": [
    "SUNDAY",
    "MONDAY",
    "TUESDAY",
    "WEDNESDAY",
    "THURSDAY",
    "FRIDAY",
    "SATURDAY"
  ],
  "call_start": "09:00",
  "call_end": "17:00",
  "timezone": "EST5EDT",
  "max_concurrent_calls": 1,
  "max_retries": 1,
  "minutes_between_retries": 5,
  "registered_number_id": {
    "$oid": "57bb010e2cd5264797b017e5"
  },
  "status": "active",
  "created_on": "2016-08-22T12:05:39.571000",
  "modified_on": "2016-08-22T12:05:39.571000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "$_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number resource."
    },
    "client_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "Your client ID."
    },
    "live_answer": {
      "type": "object",
      "properties": {
        "audio_id": {
          "type": "object",
          "properties": {
            "$oid": {
              "type": "string",
              "description": "Unique id representing the resource."
            }
          },
          "description": "The unique ID representing this resource."
        },
        "description": {
          "type": "string",
          "description": "A friendly name for the audio resource."
        },
        "offers_transfer": {
          "type": "boolean",
          "description": "Indicates if the system should offer transfer for the live answer."
        },
        "transfer_type": {
          "type": "string",
          "enum": [
            "default",
            "custom"
          ],
          "description": "Indicates whether the system should use the built-in prompt to offer transfer or if the prompt provided already includes the verbiage for offering transfer."
        },
        "transfer_number": {
          "type": "string",
          "description": "The phone number to transfer the call to when the caller chooses to transfer."
        },
        "offers_opt_out": {
          "type": "boolean",
          "description": "Indicates if the system should offer opt-out for the live answer."
        },
        "opt_out_type": {
          "type": "string",
          "enum": [
            "default",
            "custom"
          ],
          "description": "Indicates whether the system should use the built-in prompt to offer opt-out or if the prompt provided already includes the verbiage for offering opt-out."
        },
        "offers_repeat_message": {
          "type": "boolean",
          "description": "Indicates if the system should offer to repeat the promtp message for the live answer."
        },
        "repeat_message_type": {
          "type": "string",
          "enum": [
            "default",
            "custom"
          ],
          "description": "Indicates whether the system should use the built-in prompt to offer to repeat the prompt message or if the prompt provided already includes the verbiage for offering to repeat the prompt."
        }
      }
    },
    "has_machine_answer_prompt": {
      "type": "boolean",
      "description": "Indicates if a machine answer prompt is present."
    },
    "machine_answer": {
      "type": "object",
      "properties": {
        "audio_id": {
          "type": "object",
          "properties": {
            "$oid": {
              "type": "string",
              "description": "Unique id representing the resource."
            }
          },
          "description": "The unique ID representing this resource."
        },
        "description": {
          "type": "string",
          "description": "A friendly name for the audio resource."
        },
        "offers_opt_out": {
          "type": "boolean",
          "description": "Indicates if the system should offer opt-out for the live answer."
        },
        "opt_out_type": {
          "type": "string",
          "enum": [
            "default",
            "custom"
          ],
          "description": "Indicates whether the system should use the built-in prompt to offer opt-out or if the prompt provided already includes the verbiage for offering opt-out."
        },
        "opt_out_number": {
          "type": "string",
          "description": "The phone number to play to caller if they want to opt-out."
        }
      }
    },
    "contact_group_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing this resource."
    },
    "name": {
      "type": "string",
      "description": "The name of the campaign."
    },
    "type": {
      "type": "string",
      "enum": [
        "asap",
        "throttle",
        "spread"
      ],
      "description": "Represents the type of campaign."
    },
    "days_of_week": {
      "type": "array",
      "description": "Indicates on what days the calls should be sent out."
    },
    "call_start": {
      "type": "string",
      "description": "The start of the window in which the call can be attempted. The time should be formatted as HH:mm in 24H format."
    },
    "call_end": {
      "type": "string",
      "description": "The end of the window in which the call can be attempted. The time should be formatted as HH:mm in 24H format."
    },
    "timezone": {
      "type": "string",
      "enum": [
        "EST5EDT",
        "CST6CDT",
        "MST7MDT",
        "PST8PDT"
      ],
      "description": "Indicates the timezone of the call start and end windows."
    },
    "max_concurrent_calls": {
      "type": "number",
      "enum": [
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10
      ],
      "description": "Indicates the maximum simultanous calls that can be made."
    },
    "max_retries": {
      "type": "number",
      "enum": [
        1,
        2
      ],
      "description": "Indicates the number of retry attempts when the initial attempt is unsuccessful, for e.g., if the disposition was busy."
    },
    "minutes_between_retries": {
      "type": "number",
      "enum": [
        5,
        10,
        15,
        30,
        60,
        90,
        120
      ],
      "description": "Indicates the number of minutes the system should wait before attempting the retry."
    },
    "registered_number_id": {
      "type": "object",
      "properties": {
        "$oid": {
          "type": "string",
          "description": "Unique id representing the resource."
        }
      },
      "description": "The unique ID representing the registered number that should be used for the caller id."
    },
    "status": {
      "type": "string",
      "description": "Indicates the status of the campaign."
    },
    "created_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was created."
    },
    "modified_on": {
      "type": "string",
      "description": "The date and time in UTC on which this resource was modified."
    }
  }
}
Response  404
HideShow
Headers
Content-Type: application/json

Update
PUT/calls/campaign/?_id={_id}

Example URI

PUT /calls/campaign/?_id=57bb010e2cd5264797b017e5
URI Parameters
HideShow
_id
string (required) Example: 57bb010e2cd5264797b017e5

The unique ID representing the campaign resource.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
Body
{
  "status": "active"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "active",
        "paused",
        "cancelled"
      ],
      "description": "Control the status of the campaign."
    }
  }
}
Response  204
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Generated by aglio on 22 Feb 2024