Callbox

The Callbox Developer Hub

Welcome to the Callbox developer hub. You'll find comprehensive guides and documentation to help you start working with Callbox as quickly as possible, as well as support if you get stuck. Let's jump right in!

Guides
Suggest Edits

API Reference

 

The Callbox Network API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. JSON is returned by all API responses, including errors.

Suggest Edits

Authentication

 

Authenticate your account when using the API by including your API ID and your secret API key in the request. You can retrieve your API keys in your Network Dashboard > Settings.
Authentication to the API is performed via HTTP Basic Auth. Provide your API ID and API key as the basic auth username and password values respectively.

The Authorization field is constructed as follows:

1. The username and password are combined with a single colon. (:)
2. The resulting string is encoded into an octet sequence.
3. The resulting string is encoded using a variant of Base64.
4. The authorization method and a space is then prepended to the encoded string, separated with 
    a space (e.g. "Basic ").
-H "Authorization: Basic IDKjXzYyODE4YjYzNaZjY2RlNjA4OWQ5MGRiYTZkM2FhMzlmOjE4P"
Suggest Edits

Pagination

 

All top-level API resources have support for pagination. These API calls share a common structure, taking one parameters: page which specifies the page of resource you would like to receive.

The Pagination details is included in dictionary response with the meta property containing the following keys:

  • current_page: The current page of the resource
  • total_pages: The total number of pages
  • total_count: The total number of resources
Suggest Edits

Retrieve Calls

/calls

 

Basic Auth

 Authentication is required for this endpoint.
gethttp://usecallbox.com/api/v1/network/calls
curl --request GET \
  --url 'http://usecallbox.com/api/v1/network/calls?from=2017-06-26%2000%3A00%3A00&to=2017-06-26%2023%3A59%3A50'
var request = require("request");

var options = { method: 'GET',
  url: 'http://usecallbox.com/api/v1/network/calls',
  qs: 
   { from: '2017-06-26 00:00:00',
     to: '2017-06-26 23:59:50' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("http://usecallbox.com/api/v1/network/calls?from=2017-06-26%2000%3A00%3A00&to=2017-06-26%2023%3A59%3A50")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://usecallbox.com/api/v1/network/calls?from=2017-06-26%2000%3A00%3A00&to=2017-06-26%2023%3A59%3A50");

xhr.send(data);
import requests

url = "http://usecallbox.com/api/v1/network/calls"

querystring = {"from":"2017-06-26 00:00:00","to":"2017-06-26 23:59:50"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "data": [
    {
      "id": 1,
      "recording_duration": 230,
      "call_duration": 235,
      "connected_at": "2017-06-26T18:58:21Z",
      "payout": 0.0,
      "cost": 0.0,
      "source_phone_number": "+1233456890",
      "source_city": null,
      "source_region": null,
      "source_zip": null,
      "source_country": "CA",
      "publisher_id": 2,
      "publisher_name": "John Doe",
      "publisher_number": "+1237894560",
      "pool_id": 1,
      "pool_title": "Test Pool",
      "advertiser_id": 3,
      "advertiser_name": "Jason Smith",
      "campaign_id": 1,
      "campaign_title": "Test Campaign",
      "recording_url": null
    },
    {
      "id": 2,
      ...
    },
    {
      "id": 3,
      ...
    },
    ...
  ],
  "meta": {
    "current_page": 1,
    "total_pages": 14,
    "total_count": 415
  }
}

Query Params

from
date
required

Search for calls that started after this datetime. The time is formatted in 24 hour format. (yyyy-mm-dd hh:mm:ss)

to
date
required

Search for calls that started before this datetime. The time is formatted in 24 hour format. (yyyy-mm-dd hh:mm:ss)

source_number
string

Search for calls which originated from this caller's number

publisher_number
string

Search for calls which originate from this publisher number

publisher_id
int32

Search for calls belonging to this publisher

advertiser_id
int32

Search for calls belonging to this advertiser

pool_id
int32

Search for calls belonging to this pool

campaign_id
int32

campaign

state
string

Search for calls with a given state: Possible states are dropped, callbacked, connected, sale, no_sale, qualified, unqualified, unqualified, disputed, blocked, duplicate

 

Returns
A dictionary with a data property that contains an array of up to limit calls, starting after from. Each entry in the array is a separate call object. If no more calls are available, the resulting array will be empty.

Suggest Edits

API Reference

 

The Callbox Publisher API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. JSON is returned by all API responses, including errors.

Suggest Edits

Authentication

 

Authenticate your account when using the API by including your API ID and your secret API key in the request. You can retrieve your API keys in your Publisher Dashboard > My Account > API.
Authentication to the API is performed via HTTP Basic Auth. Provide your API ID and API key as the basic auth username and password value respectively.

The Authorization field is constructed as follows:

1. The username and password are combined with a single colon. (:)
2. The resulting string is encoded into an octet sequence.
3. The resulting string is encoded using a variant of Base64.
4. The authorization method and a space is then prepended to the encoded string, separated with 
    a space (e.g. "Basic ").
-H "Authorization: Basic IDKjXzYyODE4YjYzNaZjY2RlNjA4OWQ5MGRiYTZkM2FhMzlmOjE4P"
Suggest Edits

Pagination

 

All top-level API resources have support for pagination. These API calls share a common structure, taking one parameters: page which specifies the page of resource you would like to receive.

The Pagination details is included in dictionary response with the meta property containing the following keys:

  • current_page: The current page of the resource
  • total_pages: The total number of pages
  • total_count: The total number of resources
Suggest Edits

Retrieve Calls

/calls

 

Basic Auth

 Authentication is required for this endpoint.
gethttp://usecallbox.com/api/v1/publisher/calls
curl --request GET \
  --url 'http://usecallbox.com/api/v1/publisher/calls?from=from&to=2017-06-26%2023%3A59%3A50'
var request = require("request");

var options = { method: 'GET',
  url: 'http://usecallbox.com/api/v1/publisher/calls',
  qs: 
   { from: 'from',
     to: '2017-06-26 23:59:50' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("http://usecallbox.com/api/v1/publisher/calls?from=from&to=2017-06-26%2023%3A59%3A50")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://usecallbox.com/api/v1/publisher/calls?from=from&to=2017-06-26%2023%3A59%3A50");

xhr.send(data);
import requests

url = "http://usecallbox.com/api/v1/publisher/calls"

querystring = {"from":"from","to":"2017-06-26 23:59:50"}

response = requests.request("GET", url, params=querystring)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "data": [
    {
      "id" : "688d805f-505e-4a82-a321-a891bbf29499",
      "source_phone_number" : "+1233456890",
      "campaign_title" : "My Campaign - 1",
      "publisher_number" : "+3216540987",
      "connected_duration" : 263,
      "called_at" : "2017-06-26T18:58:21Z",
      "payout" : 7.0,
      "status" : "qualified"
    },
    {
      "id": 2,
      ...
    },
    {
      "id": 3,
      ...
    },
    ...
  ],
  "meta": {
    "current_page": 1,
    "total_pages": 14,
    "total_count": 415
  }
}

Query Params

from
date
required

Search for calls that started after this datetime. The time is formatted in 24 hour format. (yyyy-mm-dd hh:mm:ss)

to
date
required

Search for calls that started before this datetime. The time is formatted in 24 hour format. (yyyy-mm-dd hh:mm:ss)

source_number
string

Search for calls which originated from this caller's number

publisher_number
string

Search for calls which originate from this publisher number

campaign_id
string

Search for calls belonging to this campaign

status
string

Search for calls with a given state: Possible states are active, dropped, qualified, unqualified, fallbacked

 

Returns
A dictionary with a data property that contains an array of up to limit calls, starting after from. Each entry in the array is a separate call object. If no more calls are available, the resulting array will be empty.