CallHub Documentation

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

Get Started    API
Suggest Edits

/contacts

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v1/contacts/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {"contact": "15019028176",
  "mobile": "15019022176",
  "last_name": "Kenny",
  "first_name": "Chris",
  "country_code": "US",
  "email": "ckenny@gmeil.com",
  "address": "34786 Longboat Court",
  "city": "Portland",
  "state": "OR",
  "company_name": "IBM Inc",
  "company_website": "http://www.ibm.com/ckenny/",
  "job_title": "Project Manager"}
r = requests.post('https://api.callhub.io/v1/contacts/', data=data, headers=headers)
print "Contact created in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("contact" => "4015239987", "first_name" => "PHP API");                         $data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/contacts/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "Contact Added:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     201 Created
{
  "url": "https://api.callhub.io/v1/contacts/11738262/",
  "id": 11738262,
  "phonebooks": ["https://api.callhub.io/v1/phonebooks/78226/"],
  "contact": "15019028176",
  "mobile": "15019022176",
  "last_name": "Kenny",
  "first_name": "Chris",
  "country_code": "US",
  "email": "ckenny@gmeil.com",
  "address": "34786 Longboat Court",
  "city": "Portland",
  "state": "OR",
  "company_name": "IBM Inc",
  "company_website": "http://www.ibm.com/ckenny/",
  "job_title": "Project Manager"
}

Body Params

contact
string
required

Phone number of the contact. This is used is all voice campaigns

mobile
string

Mobile phone number of the contact. This is used in all text message campaigns

last_name
string

Last Name of the contact

first_name
string

First Name of the contact

country_code
string

2 letter country code. This is used to add the country prefix to the phone numbers, if necessary. See the full list of 2 letter country codes here http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

email
string

Email Address

address
string

Mailing address

city
string

City

state
string

State

company_name
string

Name of the company/organisation the contact belongs to

company_website
string

Website of the contact's organisation

job_title
string

Job Title/Function

 

Create a new contact

Suggest Edits

/contacts

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/contacts/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/contacts/'
r = requests.get(url, headers=headers)
print "Contacts in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		// api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
 
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/contacts/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Contacts as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 7,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "https://api.callhub.io/v1/contacts/11738262/",
          	"id": 11738262,
            "phonebooks": ["https://api.callhub.io/v1/phonebooks/78226/"],
            "contact": "15019028176",
            "mobile": "15019022176",
            "last_name": "Kenny",
            "first_name": "Chris",
            "country_code": "US",
            "email": "ckenny@gmeil.com",
            "address": "34786 Longboat Court",
            "city": "Portland",
            "state": "OR",
            "company_name": "IBM Inc",
            "company_website": "http://www.ibm.com/ckenny/",
            "job_title": "Project Manager"
        },
        //...more contacts...
    ]
}
 

Get a list of all contacts. Each contact has the following keys

Key
Value
Description

url

String

URL of the contact

phonebooks

Array

URL of all the phone books that the contact belongs to

contact

String

Phone number of the contact. This is used is all voice campaigns

mobile

String

Mobile phone number of the contact. This is used in all text message campaigns

last_name

String

Last Name of the contact

first_name

String

First Name of the contact

country_code

String

2 letter country code. This is used to add the country prefix to the phone numbers, if necessary. See the full list of 2 letter country codes here http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

email

String

Email Address

address

String

Address of the contact

city

String

City

state

String

State

company_name

String

Name of the company/organisation the contact belongs to

company_website

String

Website of the contact's organisation

job_title

String

Job Title/Function

Suggest Edits

/contacts/:id

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v1/contacts/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'contact':'4016547890', 'last_name':'this is changed through api'}
# replace contact_id with the id number of the contact you are updating
r = requests.put('https://api.callhub.io/v1/contacts/%d/'% contact_id, data=data, headers=headers)
print "Contact updated in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("contact" => "14015239987", 
                  "first_name" => "Jane",
                 "last_name" => "Bent");                        
		$data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/contacts/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "Contact Updated:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "url": "https://api.callhub.io/v1/contacts/11738262/",
  "phonebooks": ["https://api.callhub.io/v1/phonebooks/78226/"],
  "contact": "15019028176",
  "mobile": "15019022176",
  "last_name": "Kenny",
  "first_name": "Chris",
  "country_code": "US",
  "email": "ckenny@gmeil.com",
  "address": "34786 Longboat Court",
  "city": "Portland",
  "state": "OR",
  "company_name": "IBM Inc",
  "company_website": "http://www.ibm.com/ckenny/",
  "job_title": "Project Manager"
}

Path Params

id
string
required

Contact ID

Body Params

contact
string
required

Phone number of the contact. This is used is all voice campaigns

mobile
string

Mobile phone number of the contact. This is used in all text message

last_name
string

Last Name of the contact

first_name
string

First Name of the contact

country_code
string

2 letter country code. This is used to add the country prefix to the phone numbers, if necessary. See the full list of 2 letter country codes here http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

email
string

Email Address

address
string

Mailing address

city
string

City

state
string

State

company_name
string

Name of the company/organisation the contact belongs to

company_website
string

Website of the contact's organisation

job_title
string

Job Title/Functio

 

Change details of a specific contact.

Suggest Edits

/contacts/:id

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v1/contacts/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
# replace contact_id with the id number of the contact you are deleting
url = 'https://api.callhub.io/v1/contacts/%d/'% contact_id
r = requests.delete(url, headers=headers)
print "Response status :",r.status_code
<?php

    $ch = curl_init();
    //  api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";

        // replace contact_id with the id number of the contact you are deleting
    $url ="https://api.callhub.io/v1/contacts/{$contact_id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    
    $curl_response = curl_exec($ch); 
    curl_close($ch); 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Path Params

id
string
required

Contact ID

 

Delete a specific contact

Suggest Edits

/phonebooks

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v1/phonebooks/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'name':'api_phonbook', 'description':'this is created through api'}
r = requests.post('https://api.callhub.io/v1/phonebooks/', data=data, headers=headers)
print "Phonebook created in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("name" => "API Phonebook", "description" => "PHP API Phonebook");                         $data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/phonebooks/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "Phonebook Added:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     201 Created
{
    "url": "https://api.callhub.io/v1/phonebooks/79221/",
    "owner": "readme",
    "name": "Australian Friends",
    "description": "Phonebook of my Oz friends"
}

Body Params

name
string
required

Name of the phonebook to be created

description
string

Description of the new phonebook

 

Create a new phone book

Suggest Edits

/phonebooks

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/phonebooks/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/phonebooks/'
r = requests.get(url, headers=headers)
print "Phonebooks in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
  
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/phonebooks/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Phonebooks as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "https://api.callhub.io/v1/phonebooks/78220/",
            "owner": "readme",
            "name": "My UK Contacts",
            "description": ""
        },
        {
            "url": "https://api.callhub.io/v1/phonebooks/72819/",
            "owner": "readme",
            "name": "Default Phonebook",
            "description": ""
        },
        //...more phonebooks...
    ]
}
 

List all the phone books. Each phone book will have the following keys

Key
Type
Description

url

String

URL to the phone book

owner

String

User name of your CallHub account

name

String

Name of the phone book

description

String

Description of the phone book

Suggest Edits

/phonebooks/:id/

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v1/phonebooks/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'description':'this is changed through api'}
# replace phonebook_id with the id number of the phonebook you are updating
r = requests.put('https://api.callhub.io/v1/phonebooks/%d/'% phonebook_id, data=data, headers=headers)
print "Phonebook created in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("name" => "API", "description" => "Changed by API");                 $data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/phonebooks/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "Phonebook Updated:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "url": "https://api.callhub.io/v1/phonebooks/72819/",
    "owner": "readme",
    "name": "Default Phonebook",
    "description": ""
}

Path Params

id
int32
required

Phonebook ID

Body Params

name
string

Name of the phonebook

description
string

Description of the phonebook

 

Change a specific phone book.

Suggest Edits

/phonebooks/:id/

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v1/phonebooks/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
# replace phonebook_id with the id number of the phonebook you are deleting
url = 'https://api.callhub.io/v1/phonebooks/%d/'% phonebook_id
r = requests.delete(url, headers=headers)
print "Response status :",r.status_code
<?php

    $ch = curl_init();
    //  api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";

        // replace phonebook_id with the id number of the phonebook you are deleting
    $url ="https://api.callhub.io/v1/phonebooks/{$phonebook_id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    
    $curl_response = curl_exec($ch); 
    curl_close($ch); 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Path Params

id
int32
required

Phonebook ID

 

Delete a phone book.

Suggest Edits

/phonebooks/:id/contacts/

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/phonebooks/id/contacts/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
# replace phonebook_id with the id number of the phonebook whose contacts you are fetching
url = 'https://api.callhub.io/v1//phonebooks/%d/contacts/'% phonebook_id
r = requests.get(url, headers=headers)
print "Contacts of a given Phonebook in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
  
    // set URL and other appropriate options
    $url = "https://api.callhub.io/v1/phonebooks/{$phonebook_id}/contacts/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Contacts in a phonebook as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "https://api.callhub.io/v1/contacts/11738262/",
            "phonebooks": ["https://api.callhub.io/v1/phonebooks/78226/"],
            "contact": "15019028176",
            "mobile": "15019022176",
            "last_name": "Kenny",
            "first_name": "Chris",
            "country_code": "US",
            "email": "ckenny@gmeil.com",
            "address": "34786 Longboat Court",
            "city": "Portland",
            "state": "OR",
            "company_name": "IBM Inc",
            "company_website": "http://www.ibm.com/ckenny/",
            "job_title": "Project Manager"
        },
        {
            "url": "https://api.callhub.io/v1/contacts/11738232/",
            "phonebooks": ["https://api.callhub.io/v1/phonebooks/98226/"],
            "contact": "15019023176",
            "mobile": "15019022476",
            "last_name": "Foo",
            "first_name": "B",
            "country_code": "US",
            "email": "bfoo@gmeil.com",
            "address": "3436 Longboat Court",
            "city": "Port",
            "state": "CA",
            "company_name": "My Inc",
            "company_website": "http://www.my.com/ckenny/",
            "job_title": ""
        },
        //...more contacts...
    ]
}

Path Params

id
int32
required

Phonebook ID

 

List all contacts in the phone book. Each contact will have all contact details.

Suggest Edits

/phonebooks/:id/contacts/

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v1/phonebooks/id/contacts/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'contact_ids': ['23987753','23987754',]}
# replace phonebook_id with the id number of the phonebook to which you are adding contacts
r = requests.post('https://api.callhub.io/v1/phonebooks/%d/contacts/'% phonebook_id, data=data, headers=headers)
print "Contacts created in phonebook in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("contact_ids" => array("24914620","24677263"));
		$data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/phonebooks/{$id}/contacts/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "Contacts Added to Phonebook:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "url":"http://api.callhub.io/v1/phonebooks/139/",
  "id":139,
  "owner":"gaglers",
  "name":"testing 3 results - Feb 02, 12:37",
  "description":"Results from Call Center campaign: testing 3 on Feb 02, 12:37",
  "count":"3"
}

Path Params

id
int32
required

Phonebook ID

Body Params

contact_ids
array of strings
required

Array of contact IDs

 

Adds a list of existing contacts to a phonebook.

Suggest Edits

/phonebooks/:id/contacts/

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v1/phonebooks/id/contacts/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'contact_ids': ['23987753']}
# replace phonebook_id with the id number of the phonebook from which you are deleting contacts
r = requests.delete('https://api.callhub.io/v1/phonebooks/%d/contacts/'% phonebook_id, data=data, headers=headers)
print "Contacts deleted in phonebook in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("contact_ids" => array("24914620","24677263"));
		$data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/phonebooks/{$id}/contacts/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "Contacts Added to Phonebook:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "url":"http://api.callhub.io/v1/phonebooks/13439/",
  "id":13439,
  "owner":"jhobbs",
  "name":"testing 3 results - Feb 02, 12:37",
  "description":"Results from Call Center campaign: testing 3 on Feb 02, 12:37",
  "count":"3"
}

Path Params

id
int32
required

Phonebook ID

Body Params

contact_ids
array of strings
required

Array of contact IDs

 

Removes a list of existing contacts from a phonebook.

Suggest Edits

/phonebooks/:id/create_contact/

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v1/phonebooks/id/create_contact/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {"contact": "15019028178",
  "mobile": "15019022179",
  "last_name": "Kenny1",
  "first_name": "Chris1",
  "country_code": "US",
  "email": "ckenny1@gmail.com",
  "address": "34786 Longboat Court",
  "city": "Portland",
  "state": "OR",
  "company_name": "IBM Inc",
  "company_website": "http://www.ibm.com/ckenny/",
  "job_title": "Project Manager"}
r = requests.post('https://api.callhub.io/v1/phonebooks/%d/create_contact/'%phonebook_id, data=data, headers=headers)
print "Contact created in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("contact" => "4015239687", 
                  "first_name" =>  "API Contact",
                  "last_name" => "Last",
                   "mobile" => "4327896543"); 
		$data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/phonebooks/{$id}/create_contact/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "Contacts Created in Phonebook:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     201 Created
{
  "url":"http://api.callhub.io/v1/phonebooks/11139/",
  "id":11139,
  "owner":"jhobbs",
  "name":"testing 3 results - Feb 02, 12:37",
  "description":"Results from Call Center campaign: testing 3 on Feb 02, 12:37",
  "count":"3"
}

Path Params

id
int32
required

Phonebook ID

Body Params

contact
string
required

Phone number of the contact. This is used is all voice campaigns

mobile
string

Mobile phone number of the contact. This is used in all text message campaigns

last_name
string

Last Name of the contact

first_name
string

First Name of the contact

country_code
string

2 letter country code. This is used to add the country prefix to the phone numbers, if necessary. See the full list of 2 letter country codes here http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

email
string

Email Address

address
string

Mailing address

city
string

City

state
string

State

company_name
string

Name of the company/organisation the contact belongs to

company_website
string

Website of the contact's organisation

job_title
string

Job Title/Function

 

Create a new contact in an existing phonebook

Suggest Edits

/webhooks

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v1/webhooks/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'event':'vb.transfer', 'target':'https://zapier.com/hooks/standard/YDeFSJf6DEADsLswYRBEEFtP/'}
r = requests.post('https://api.callhub.io/v1/webhooks/', data=data, headers=headers)
print "Webhook created in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("event" => "vb.transfer", 
                  "target" =>"https://zapier.com/hooks/standard/YDeFSJf6DEADsLswYRBEEFtP/");     $data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/webhooks/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "Webhook Added:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     201 Created
{
 "id": 701,
 "url": "https://api.callhub.io/v1/webhooks/701/",
 "user": "https://api.callhub.io/v1/users/139616/",
 "created": "2015-04-06T17:21:15.849779Z",
 "updated": "2015-04-06T17:21:15.849812Z",
 "event": "vb.transfer",
 "target": "https://zapier.com/hooks/standard/YDeFSJf6DEADsLswYRBEEFtP/"
}

Body Params

event
string
required

CallHub Event for which you want the webhook to be called for

target
string
required

Target URL that must be called when the event occurs

 

Create new web hook. See below for possible values for event and when they are fired

Event
Description

vb.transfer

Occurs when the transfer digit is pressed in a voice broadcast campaign

sb.reply

Occurs when a text reply is received in your CallHub account

bphone.call

Occurs when an incoming phone call is received to your business phone or when an outgoing call is made from your business phone

bphone.voicemail

Occurs when a voice mail is received for your business phone number

cc.notes

Occurs when a note is added by a call center agent

agent.activation

Occurs when agent activates their account by clicking on the activation link

The following keys will be received as data when the vb.transfer event occurs.

Key
Value
Description

audio_url

String

URL to the Audio Message received, if it exists

transcript_content

String

Transcript of the Audio Message received, if transcript is enabled

from_number

String

Phone number from which the transfer digit was pressed

transcript_url

String

URL to the transcript of the Audio Message received, if transcript is enabled

campaign

String

Name of the Voice Broadcast Campaign that generated this event

The following keys will be received as data when the sb.reply event occurs.

Key
Value
Description

content

String

Content of the message received

from_name

String

Name of the person sending the text message

from_number

String

Phone number of the person sending the text message

campaign

String

Name of the text campaign that this reply is received for

The following keys will be received as data when the bphone.voicemail event occurs.

Key
Value
Description

username

String

CallHub username

recording_url

String

URL of the voicemail received

from_number

String

Phone number from which the voicemail was received

bphone

String

Business Phone number for which the voicemail was received

extension

String

Extension digit that was pressed

The following keys will be received as data when the bphone.call event occurs.

Key
Value
Description

username

String

CallHub username

call_direction

String

Indicates whether this was a "outbound" call or a "inbound" call

caller

String

For Future Use

to_number

String

Phone number to which the call is made

charge

Decimal

Cost of the call

from_number

String

Phone number from which the call is made

bphone

String

Business Phone number in CallHub

recording_url

String

URL to the Audio Recording of the call

hangup_cause

String

Reason for the call hangup

The following keys will be received as data when the cc.notes event occurs.

Key
Value
Description

city

String

City of the person

first_name

String

Person's first name

last_name

String

Person's last name

campaign

String

Call center campaign name

mobile

String

Mobile number of the Person

country

String

Person's country

notes

String

Notes saved by the agent

zipcode

String

Person's zipcode

record_url

String

Recording of the conversation between agent and person

company_website

String

Website of person's company

state

String

State to which person belongs

contact

String

Contact Number of the person

nationbuilder_tags

String

Nation Builder Tags associated with the person

nationbuilder_id

Integer

Nation Builder Id of the contact

company_name

String

Name of the company where person works

email

String

Email address of the contact

address

String

Address where person stays

job_title

String

Person's job title

disposition

String

Disposition selected for this call

surveys

Array

Key value pairs of survey questions and responses

agent.id

Integer

Id of the agent who saved notes

agent.username

String

username of the agent who saved notes

agent.email

String

email address of the agent for whom the notes were added

agent.nationbuilder_id

Integer

Nation Builder Id of the agent

The following keys will be received as data when the agent.activation event occurs.

Key
Value
Description

id

Integer

Id of the agent that got activated

username

String

username of the activated agent

email

String

Email address of the agent

activated_at

String

Date time in UTC when agent got activated

Example Event Hook Responses

{
 "hook": {}, 
 "data": {
          "audio_url": "https://s3.amazonaws.com/recordings/1c112f10-d15a-1964-b894-842bFE5655.mp3", 
          "transcript_content": "Hey, Thanks for the call. See you on Friday", 
          "from_number": "15104024173", 
          "transcript_url": "https://s3.amazonaws.com/recordings/1c112f10-d15a-1964-b894-842bFE5655.txt", 
          "campaign": "Voice Broadcast, Apr 03, 06:42"
         }
}
{
  "hook": {}, 
  "data": {
           "content": "Yes, I will be there!", 
           "from_name": "John Doe", 
           "from_number": "16502293681", 
           "campaign": "Friday Party Invite"
           }
}
{
    "hook": {},
    "data": {
        "username": "readme",
        "recording_url": "https://s3.amazonaws.com/recordings/1cbf2f10-e15a-1FF4-f894-37DEAD655.mp3",
        "from_number": "1661990240",
        "bphone": "13528889088",
        "extension": "1"
    }
}
{
    "hook": {},
    "data": {
        "username": "readme",
        "call_direction": "inbound",
        "caller": null,
        "to_number": "13523649088",
        "charge": 1.875,
        "from_number": "16617380240",
        "bphone": "13523739088",
        "recording_url": "https://s3.amazonaws.com/recordings/1c112f10-d15a-1964-b894-842bFE5655.mp3",
        "hangup_cause": "answer"
    }
}
{
    "city": "Santa Clara",
    "first_name": "John",
    "last_name": "Doe",
    "campaign": "Fishy Campaign",
    "mobile": "16507868629",
    "country": "HU",
    "notes": "This person loves fish!",
    "zipcode": "50103",
    "record_url": "https://s3.amazonaws.com/recordings/081eecf6-dsfdsgdfg4e051700.mp3",
    "company_website": "https://callhub.io/",
    "state": "CA",
    "contact": "16507868628",
    "nationbuilder_tags": [
      "survey responded",
      "fish owner"
    ],
    "company_name": "CallHub",
    "address": "Genesis Suncity",
    "job_title": "Engineer",
  	"disposition": "MEANINGFUL_INTERACTION",
  	"surveys": [
      {"answer": "A", "type": "MultiChoice", "question": "You like A or B?"}, 
      {"answer": "My Text", "type": "Text", "question": "What is your text?"}, 
      {"answer": 32, "type": "Numeric", "question": "Your age?"}
   	],
}
Suggest Edits

/webhooks

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/webhooks/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/webhooks/'
r = requests.get(url, headers=headers)
print "webhooks in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
   
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/webhooks/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Webhooks as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 20,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 701,
            "url": "https://api.callhub.io/v1/webhooks/701/",
            "user": "https://api.callhub.io/v1/users/139616/",
            "created": "2015-04-06T17:21:15.849779Z",
            "updated": "2015-04-06T17:21:15.849812Z",
            "event": "vb.transfer",
            "target": "https://zapier.com/hooks/standard/YDeFSJf6DEADsLswYRBEEFtP/"
        },
      //...more hooks...
    ]
}
 

List of Webhooks that are registered

Key
Value
Description

id

Integer

ID of the webhook

url

String

URL to the webhook

user

String

URL of the user details endpoint

created

String

Date of creation of the webhook

updated

String

Last change time

event

String

CallHub Event on which the webhook will get fired

target

String

URL that will be called when the event is fired in CallHub

Suggest Edits

/webhooks/:id

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v1/webhooks/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
# replace webhooks_id with the id number of the Webhook you are deleting
url = 'https://api.callhub.io/v1/webhooks/%d/'% webhooks_id
r = requests.delete(url, headers=headers)
print "Response status :",r.status_code
<?php

    $ch = curl_init();
    //  api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";

        // replace webhook_id with the id number of the phonebook you are deleting
    $url ="https://api.callhub.io/v1/webhooks/{$webhook_id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    
    $curl_response = curl_exec($ch); 
    curl_close($ch); 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Path Params

id
string
required

Webhook ID to be deleted

 

Delete a web hook.

Suggest Edits

/callcenter_campaigns

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/callcenter_campaigns/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/callcenter_campaigns/'
r = requests.get(url, headers=headers)
print "Callcenter Campaigns in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
   
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/callcenter_campaigns/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Callcenter Campaigns as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 8,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "https://api.callhub.io/v1/callcenter_campaigns/2754/",
            "owner": "readme",
            "name": "Second Campaign",
            "status": 4,
            "phonebook": ["https://api.callhub.io/v1/phonebooks/1332/","https://api.callhub.io/v1/phonebooks/1224/"]
        },
				//..more campaigns...
    ]
}
 

List of all your Call Center Campaigns. Each campaign has the following keys

Key
Value
Description

url

String

URL of the call center campaign

owner

String

CallHub User Name

name

String

Name of the campaign

status

Integer

Status of the campaign. It corresponds to the following status:

1 - START

2 - PAUSE

3- ABORT

4- END

phonebook

Array

Array of URLs of the phone books associated with this campaign

Suggest Edits

/callcenter_campaigns/:id

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v1/callcenter_campaigns/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'status':'4', 'name' : 'Updated with api'}
# replace campaign_id with the id number of the campaign you are updating
r = requests.put('https://api.callhub.io/v1/callcenter_campaigns/%d/'% campaign_id, data=data, headers=headers)
print "Callcenter Campaign Updated in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("name" => "API Update", "status" => "2");                 
		$data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/callcenter_campaigns/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "Call center campaign Updated:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "url": "https://api.callhub.io/v1/callcenter_campaigns/2754/",
  "owner": "readme",
  "name": "Second Campaign",
  "status": 4,
  "phonebook": ["https://api.callhub.io/v1/phonebooks/1332/","https://api.callhub.io/v1/phonebooks/1224/"]
}

Path Params

id
int32
required

ID of the campaign

Body Params

name
string

Name of the campaign

status
int32

Status of the campaign

 

Update a specific Call Center Campaign

Suggest Edits

/callcenter_campaigns/:id

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v1/callcenter_campaigns/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
# replace callcenter_campaigns_id with the id number of the Callcenter campaign you are deleting
id = callcenter_campaigns_id
url = 'https://api.callhub.io/v1/callcenter_campaigns/%d/'% id
r = requests.delete(url, headers=headers)
print "Response status :",r.status_code
<?php

    $ch = curl_init();
    //  api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";

        // replace id with the id number of the callcenter campaign you are deleting
    $url ="https://api.callhub.io/v1/callcenter_campaigns/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    
    $curl_response = curl_exec($ch); 
    curl_close($ch); 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Path Params

id
int32
required

ID of the campaign

 

Delete a specific Call Center Campaign

Suggest Edits

/voice_broadcasts

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/voice_broadcasts/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/voice_broadcasts/'
r = requests.get(url, headers=headers)
print "Voice Broadcast Campaigns in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
   
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/voice_broadcasts/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Voice Broadcasts as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "https://api.callhub.io/v1/voice_broadcasts/23204/",
            "owner": "readme",
            "name": "Rent Due Reminder",
          	"frequency":60,
            "status": 4,
            "phonebook": ["https://api.callhub.io/v1/phonebooks/1332/","https://api.callhub.io/v1/phonebooks/1224/"]
        },
        //...more campaigns...
    ]
}
 

List of all your voice broadcast campaigns. Each campaign has the following keys:

Key
Value
Description

url

String

URL of the voice broadcasting campaign

owner

String

CallHub User Name

name

String

Name of the campaign

frequency

Integer

Number of calls per minute

status

Integer

Status of the campaign. It corresponds to the following status:

1 - START

2 - PAUSE

3- ABORT

4- END

phonebook

Array

Array of phone books associated with this campaign

Suggest Edits

/voice_broadcasts/:id

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v1/voice_broadcasts/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'status':'1','name' : 'Updating'}
# replace campaign_id with the id number of the campaign you are updating
r = requests.put('https://api.callhub.io/v1/voice_broadcasts/%d/'% campaign_id, data=data, headers=headers)
print "Callcenter Campaign Updated in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("name" => "API Update", "status" => "2", "frequency" => "85");                 
		$data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/voice_broadcasts/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "Voice campaign Updated:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
 "url": "https://api.callhub.io/v1/voice_broadcasts/23204/",
 "owner": "readme",
 "name": "Rent Due Reminder",
 "status": 4,
 "frequency":60,
 "phonebook": ["https://api.callhub.io/v1/phonebooks/1332/","https://api.callhub.io/v1/phonebooks/1224/"]
}

Path Params

id
int32
required

ID of the campaign

Body Params

name
string

Name of the campaign

status
int32

Status of the campaign

frequency
int32

Number of calls per minute

 

Change a specific voice broadcast campaign

Suggest Edits

/voice_broadcasts/:id

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v1/voice_broadcasts/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
# replace voice_broadcasts_id with the id number of the Voice Broadcast campaign you are deleting
id = voice_broadcasts_id
url = 'https://api.callhub.io/v1/voice_broadcasts/%d/'% id
r = requests.delete(url, headers=headers)
print "Response status :",r.status_code
<?php

    $ch = curl_init();
    //  api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";

        // replace id with the id number of the voice broadcast campaign you are deleting
    $url ="https://api.callhub.io/v1/voice_broadcasts/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    
    $curl_response = curl_exec($ch); 
    curl_close($ch); 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Path Params

id
int32
required

ID of the campaign

 

Delete a specific voice broadcast campaign

Suggest Edits

/sms_campaigns

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/sms_campaigns/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/sms_campaigns/'
r = requests.get(url, headers=headers)
print "SMS Campaigns in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
   
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/sms_campaigns/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "SMS campaigns as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 6,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "https://api.callhub.io/v1/sms_campaigns/34512/",
            "owner": "readme",
            "name": "Friday Party Invite",
            "status": 4,
            "phonebook": ["https://api.callhub.io/v1/phonebooks/1332/","https://api.callhub.io/v1/phonebooks/1224/"]
        },
        //...more campaigns...
    ]
}
 

List of all your SMS campaigns. Each campaign has the following keys

Key
Value
Description

url

String

URL of the SMS campaign

owner

String

CallHub User Name

name

String

Name of the campaign

status

Integer

Status of the campaign. It corresponds to the following status.

1 - START

2 - PAUSE

3- ABORT

4- END

phonebook

Array

Array of phone books associated with this campaign

Suggest Edits

/sms_campaigns/:id

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v1/sms_campaigns/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'status':'4', 'name' : 'Updated from API'}
# replace campaign_id with the id number of the campaign you are updating
r = requests.put('https://api.callhub.io/v1/sms_campaigns/%d/'% campaign_id, data=data, headers=headers)
print "Callcenter Campaign Updated in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("name" => "API Update", "status" => "2");                 
		$data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/sms_campaigns/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "Call center campaign Updated:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
 "url": "https://api.callhub.io/v1/sms_campaigns/34512/",
 "owner": "readme",
 "name": "Friday Party Invite",
 "status": 4,
 "phonebook": ["https://api.callhub.io/v1/phonebooks/1332/","https://api.callhub.io/v1/phonebooks/1224/"]
}

Path Params

id
int32
required

ID of the campaign

Body Params

name
string

Name of the campaign

status
int32

Status of the campaign

 

Change a specific SMS campaign

Suggest Edits

/sms_campaigns/:id

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v1/sms_campaigns/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
# replace sms_campaigns_id with the id number of the sms campaign you are deleting
id = sms_campaigns_id
url = 'https://api.callhub.io/v1/sms_campaigns/%d/'% id
r = requests.delete(url, headers=headers)
print "Response status :",r.status_code
<?php

    $ch = curl_init();
    //  api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";

        // replace id with the id number of the sms campaign you are deleting
    $url ="https://api.callhub.io/v1/sms_campaigns/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    
    $curl_response = curl_exec($ch); 
    curl_close($ch); 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Path Params

id
int32
required

ID of the campaign

 

Delete a specific SMS campaign

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/bphone/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/bphone/'
r = requests.get(url, headers=headers)
print "Business phone in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
  
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/bphone/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Business Phones as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "https://api.callhub.io/v1/bphone/496/",
            "owner": "readme",
            "phone_number": "18902502143",
            "is_default": true,
            "extensions": [
                "https://api.callhub.io/v1/bphone_extn/38/",
                "https://api.callhub.io/v1/bphone_extn/90/"
            ]
        },
        //...more phones...
    ]
}
 

Lists all your business phones. Each business phone has the following keys

Key
Value
Description

url

String

URL of the specific business phone

owner

String

CallHub User Name

phone_number

String

Phone number

is_default

Boolean

"true" when this business phone is the default phone number on the account, "false" otherwise

extensions

Array

Array of URLs to all the extensions configured on this business phone

Suggest Edits

/bphone_extn

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/bphone_extn/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/bphone_extn/'
r = requests.get(url, headers=headers)
print "Business phone extensions in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
   
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/bphone_extn/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Business Phone extensions as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "https://api.callhub.io/v1/bphone_extn/38/",
            "phone": "https://api.callhub.io/v1/bphone/496/",
            "extension": 1,
            "numbers": "18008098721,16509873377"
        },
        //...more extensions...
    ]
}
 

List of all extensions configured on the business phones. Each extension has the following keys

Key
Value
Description

url

String

URL of the extension

phone

String

URL of the business phone the extension is configured for

extension

Integer

Extension digit to be pressed

numbers

String

Comma separated list of phone numbers to which the incoming call is to be transferred

Suggest Edits

/bphone_log

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/bphone_log/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/bphone_log/'
r = requests.get(url, headers=headers)
print "Business phone logs in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
   
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/bphone_log/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Business Phone logs as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 226,
    "next": "https://api.callhub.io/v1/bphone_log/?page=2",
    "previous": null,
    "results": [
        {
            "url": "https://api.callhub.io/v1/bphone_log/3423/",
            "bphone": "https://api.callhub.io/v1/bphone/496/",
            "callid": "566d4786-dc6a-11e4-904e-cfff893f0d7",
            "from_number": "16104029133",
            "to_number": "18772502173",
            "call_direction": "inbound",
            "starting_date": "2015-04-07T14:36:42.574660Z",
            "charge": 5.2,
            "hangup_cause": "no-answer",
            "recording_url": "https://s3.amazonaws.com/recordings/6c4bf1a4-dc6a-ffe4-ab5e-4b2b71718.mp3"
        },
         //...more log entries...
    ]
}
 

List of all call records for a business phone. Each call record has the following keys

Key
Value
Description

url

String

URL to this specific call log

bphone

String

URL to the business phone that the call record belongs to

callid

String

Unique Identifier for the call

from_number

String

Phone number from which the call was made

to_number

String

Destination phone number

call_direction

String

Indicates whether the call was a "inbound" or "outbound" call

starting_date

String

Time of the call

charge

Decimal

Cost of the call in cents

hangup_cause

String

Reason for the call hangup

recording_url

String

URL to the Audio recording of the call

Suggest Edits

/users

Calling /users will return your user information along with its related objects

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/users/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/users/'
r = requests.get(url, headers=headers)
print "Users in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
   
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/users/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Users as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "https://api.callhub.io/v1/users/6783/",
            "username": "readme",
            "email": "hello@callhub.io",
            "bphones": [
                "https://api.callhub.io/v1/bphone/49765/"
            ],
            "phonebooks": [
                "https://api.callhub.io/v1/phonebooks/78220/",
                "https://api.callhub.io/v1/phonebooks/72819/"
            ],
            "voice_broadcasts": [
                "https://api.callhub.io/v1/voice_broadcasts/22604/"
            ],
            "sms_campaigns": [
                "https://api.callhub.io/v1/sms_campaigns/51262/",
                "https://api.callhub.io/v1/sms_campaigns/17466/",
                "https://api.callhub.io/v1/sms_campaigns/12873/",
                "https://api.callhub.io/v1/sms_campaigns/113459/",
                "https://api.callhub.io/v1/sms_campaigns/10564/",
                "https://api.callhub.io/v1/sms_campaigns/184564/"
            ],
            "callcenter_campaigns": [
                "https://api.callhub.io/v1/callcenter_campaigns/2441/",
                "https://api.callhub.io/v1/callcenter_campaigns/1024/",
                "https://api.callhub.io/v1/callcenter_campaigns/9450/",
                "https://api.callhub.io/v1/callcenter_campaigns/14562/",
                "https://api.callhub.io/v1/callcenter_campaigns/1700/",
                "https://api.callhub.io/v1/callcenter_campaigns/6324/",
                "https://api.callhub.io/v1/callcenter_campaigns/6124/",
                "https://api.callhub.io/v1/callcenter_campaigns/8149/"
            ]
        }
    ]
}
 

Each user will have the following keys

Key
Value
Description

url

String

The user URL

username

String

CallHub user name

email

String

Email address of the CallHub account

bphones

Array

Array of urls to the business phones in the account

phonebooks

Array

Array of urls to the phonebooks in the account

voice_broadcasts

Array

Array of voice campaigns in the account

sms_campaigns

Array

Array of SMS campaigns in the account

callcenter_campaigns

Array

Array of Call Center campaigns in the account

Suggest Edits

/dnc_contacts

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v1/dnc_contacts/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'dnc':'https://api.callhub.io/v1/dnc_lists/5769/','phone_number' : '4015872345'}
r = requests.post('https://api.callhub.io/v1/dnc_contacts/', data=data, headers=headers)
print "DNC list contact created in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("dnc" => "https://api.callhub.io/v1/dnc_lists/5769/",
                  "phone_number" => "4015872346");                        
		$data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/dnc_contacts/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "DNC Contact Added:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     201 Created
{
  "url": "https://api.callhub.io/v1/dnc_contacts/11738262/",
  "dnc": "https://api.callhub.io/v1/dnc_lists/78226/",
  "phone_number": "15019028176"
}

Body Params

dnc
string
required

URL of the DNC list that the phone number belongs to

phone_number
string
required

Phone number of the contact.

 

Create a new contact

Suggest Edits

/dnc_contacts

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/dnc_contacts/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/dnc_contacts/'
r = requests.get(url, headers=headers)
print "Do not Call Contacts in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
   
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/dnc_contacts/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Do not call Contacts as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 7,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "https://api.callhub.io/v1/dnc_contacts/11738262/",
            "dnc": "https://api.callhub.io/v1/dnc_lists/78226/",
            "phone_number": "15019028176"
        },
        //...more dnc contacts...
    ]
}
 

Get a list of all DNC contacts. Each contact has the following keys

Key
Value
Description

url

String

URL of the dnc contact

dnc

String

URL of the DNC list that the contact belongs to

phone_number

String

Phone number of the contact.

Suggest Edits

/dnc_contacts/:id

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v1/dnc_contacts/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'dnc':'https://api.callhub.io/v1/dnc_lists/78226/', 'phone_number' : '1234567890'}
# replace dnc_contact_id with the id number of the dnc contact you are updating
r = requests.put('https://api.callhub.io/v1/dnc_contacts/%d/'% dnc_contact_id, data=data, headers=headers)
print "DNC contact Updated in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("dnc" => "https://api.callhub.io/v1/dnc_lists/78226/",
                  "phone_number" => "1234567890");                 
		$data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/dnc_contacts/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "DNC contact Updated:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "url": "https://api.callhub.io/v1/dnc_contacts/11738262/",
  "phonebook": "https://api.callhub.io/v1/dnc_lists/78226/",
  "phone_number": "15019028176"
}

Path Params

id
string
required

DNC Contact ID

Body Params

dnc
string
required

URL of the DNC list that the contact belongs to

phone_number
string
required

Phone number of the contact

 

Change details of a specific contact.

Suggest Edits

/dnc_contacts/:id

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v1/dnc_contacts/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
# replace dnc_contact_id with the id number of the DNC contact you are deleting
id = dnc_contact_id
url = 'https://api.callhub.io/v1/dnc_contacts/%d/'% id
r = requests.delete(url, headers=headers)
print "Response status :",r.status_code
<?php
	  $ch = curl_init();
    //  api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";

        // replace id with the id number of the dnc contact you are deleting
    $url ="https://api.callhub.io/v1/dnc_contacts/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    
    $curl_response = curl_exec($ch); 
    curl_close($ch); 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Path Params

id
string
required

DNC Contact ID

 

Delete a specific contact

Suggest Edits

/dnc_lists

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v1/dnc_lists/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'name':'Do not Call API list'}
r = requests.post('https://api.callhub.io/v1/dnc_lists/', data=data, headers=headers)
print "DNC list created in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("name" => "Do not Call API list");                        
		$data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/dnc_lists/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "DNC List Added:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     201 Created
{
    "url": "https://api.callhub.io/v1/dnc_lists/79221/",
    "owner": "readme",
    "name": "Do not Call Friends"
}

Body Params

name
string
required

Name of the DNC list to be created

 

Create a new phone book

Suggest Edits

/dnc_lists

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/dnc_lists/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/dnc_lists/'
r = requests.get(url, headers=headers)
print "Do not Call Lists in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
  
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/dnc_lists/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Do not call Lists as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "https://api.callhub.io/v1/dnc_lists/78220/",
            "owner": "readme",
            "name": "My UK Contacts"
        },
        {
            "url": "https://api.callhub.io/v1/dnc_lists/72819/",
            "owner": "readme",
            "name": "Default Phonebook"
        },
        //...more DNC lists...
    ]
}
 

List all the phone books. Each phone book will have the following keys

Key
Type
Description

url

String

URL to the DNC list

owner

String

User name of your CallHub account

name

String

Name of the DNC list

Suggest Edits

/dnc_lists/:id/

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v1/dnc_lists/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'name':'DNC list updated by API'}
# replace dnc_list_id with the id number of the dnc list you are updating
r = requests.put('https://api.callhub.io/v1/dnc_lists/%d/'% dnc_list_id, data=data, headers=headers)
print "DNC list Updated in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("name" => "Updated by API");                 
		$data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/dnc_lists/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "DNC list Updated:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
    "url": "https://api.callhub.io/v1/dnc_lists/72819/",
    "owner": "readme",
    "name": "Default DNC List"
}

Path Params

id
int32
required

DNC list ID

Body Params

name
string

Name of the DNC list

 

Change a specific phone book.

Suggest Edits

/dnc_lists/:id/

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v1/dnc_lists/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
# replace dnc_list_id with the id number of the DNC list you are deleting
id = dnc_list_id
url = 'https://api.callhub.io/v1/dnc_lists/%d/'% id
r = requests.delete(url, headers=headers)
print "Response status :",r.status_code
<?php
	  $ch = curl_init();
    //  api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";

        // replace id with the id number of the dnc list you are deleting
    $url ="https://api.callhub.io/v1/dnc_lists/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    
    $curl_response = curl_exec($ch); 
    curl_close($ch); 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Path Params

id
int32
required

DNC List ID

 

Delete a phone book.

Suggest Edits

/agents

Get all the verified agents in your account

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/agents/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/agents/'
r = requests.get(url, headers=headers)
print "Agents in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
   
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.callhub.io/v1/agents/");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Agents as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 1,
      "username": "abc",
      "email": "abc@callhub.io",
      "owner": [
        {
          "username": "manager",
          "url": "https://api.callhub.io/v1/users/2/"
        }
      ]
    },
    {
      "id": 2,
      "username": "xyz",
      "email": "xyz@callhub.io",
      "owner": [
        {
          "username": "manager",
          "url": "https://api.callhub.io/v1/users/2/"
        }
      ]
    }
  ]
}
 

View all agents

Suggest Edits

/agents/:id

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/agents/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
# replace agent_id with the id number of the agent you are fetching
url = 'https://api.callhub.io/v1/agents/%d/'% agent_id
r = requests.get(url, headers=headers)
print "Agents in JSON", r.json()
<?php
    // create a new cURL resource
    $ch = curl_init();
		# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
   
    // set URL and other appropriate options
		// replace agent_id with the id number of the agent you are fetching
    $url ="https://api.callhub.io/v1/agents/{$agent_id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
  	curl_close($ch); // close cURL resource 
    
		$decoded = json_decode($curl_response,true);
    print "Agent as Array:"; var_export($decoded);
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "id": 1,
  "username": "abc",
  "email": "abc@callhub.io",
  "owner": [
    {
      "username": "manager",
      "url": "https://api.callhub.io/v1/users/2/"
    }
  ]
}

Path Params

id
int32
required

Agent Id

 

List agent with agent Id

Key
Type
Description

id

Integer

Agent Id

username

String

Agent username

email

String

Agent email address

owner

String

Agent's owner

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v1/agents/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'username':'api_agent1','email' : 'apiagent1@abc.xyz.com', 'team':'france'}
r = requests.post('https://api.callhub.io/v1/agents/', data=data, headers=headers)
print "Agent created in JSON", r.json()
<?php
		$ch = curl_init();
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";
		
		$data = array("username" => "APIagent",
                 "email" => "abc@xyz.com",
                 "team" => "France",);                        
		$data_to_post = json_encode($data);   
  
    $url ="https://api.callhub.io/v1/agents/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_post);

    $curl_response = curl_exec($ch); // Send request
		curl_close($ch);
     
		$decoded = json_decode($curl_response,true);
		print "Agent Added:". var_export($decoded);
 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     201 Created
{
  "username": "agent1",
  "email": "abc@xyz.com",
}

Body Params

username
string

Username of the agent to be registered

email
string

Email address of the agent where invite is sent

team
string

Agent will be part of this team name

 

Api to create an agent. On POST, an agent gets created but no owner is assigned. Agents will receive an email for verification. Once they verify their account, owner gets assigned and then they are free to make calls

Suggest Edits

/agents/:id

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v1/agents/id/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
# replace agent_id with the id number of the agent you are deleting
id = agent_id
url = 'https://api.callhub.io/v1/agents/%d/'% id
r = requests.delete(url, headers=headers)
print "Response status :",r.status_code
<?php
	  $ch = curl_init();
    //  api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
    $headers = array();
    $headers[] = "Authorization: token {$api_key}";
    $headers[] = "Content-Type: application/json";

        // replace id with the id number of the agent you are deleting
    $url ="https://api.callhub.io/v1/agents/{$id}/";
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    
    $curl_response = curl_exec($ch); 
    curl_close($ch); 
?>
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Path Params

id
int32
required

Id of the agent to be deleted

 

Deletes the agent with the given Id

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/teams/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
url = 'https://api.callhub.io/v1/teams/'
r = requests.get(url, headers=headers)
print "Agents in JSON", r.json()
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 2,
      "name": "France",
      "created_at": "2016-06-28T06:16:49.997897Z"
    },
    {
      "id": 1,
      "name": "MyTeam",
      "created_at": "2016-06-21T12:26:05.004089Z"
    }
  ]
}
 

Teams API to list all the teams in your account

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v1/teams/
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
data = {'name':'apiTeam'}
r = requests.post('https://api.callhub.io/v1/teams/', data=data, headers=headers)
print "Agent created in JSON", r.json()
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{"id":3,"name":"apiTeam","created_at":"2016-06-28T06:28:27.219053Z"}

Body Params

name
string

Name of Team you want to create

 

Creating a new team through API

Suggest Edits

/teams/:id

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v1/teams/id
# You'll need to install requests
import requests
# api_key can be found at https://callhub.io/user_detail_change/?action=tabs-1
headers = {'Authorization': 'Token %s' % api_key}
# replace team_id with the id of your team
id = team_id
url = 'https://api.callhub.io/v1/teams/%d/'% id
r = requests.get(url, headers=headers)
print "Response status :",r.status_code
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "id": 1,
  "name": "MyTeam",
  "created_at": "2016-06-21T12:26:05.004089Z"
}

Path Params

id
int32
required

Team Id

 

View an existing team using team id

Suggest Edits

/teams/:id/agents

Adds a list of existing agents to the team

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v1/teams/id/agents
import requests, json
headers = {'Authorization': 'Token <You API Key>', 'Content-Type': 'application/json'}
data = {'agent_ids':['<Agent Id 1>', '<Agent Id 2>']}
r = requests.put('https://api.callhub.io/v1/teams/<Your team Id>/agents/', data=json.dumps(data), headers=headers)
print r.json()
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{u'created_at': u'2016-06-21T12:26:05.004089Z', u'id': 123, u'name': u'MyTeam'}

Body Params

agent_ids
array of integers
 

API to assign existing agents to a team

Suggest Edits

/teams/:id/agents

Remove existing agents from a team

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v1/teams/id/agents
import requests, json
headers = {'Authorization': 'Token <Your API Key>', 'Content-Type': 'application/json'}
data = {'agent_ids':['<Agent Id>', '<Agent Id>']}
r = requests.delete('https://api.callhub.io/v1/teams/<Your Team Id>/agents/', data=json.dumps(data), headers=headers)
print r
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
Try the API to see results

Body Params

agent_ids
array of integers
 
Suggest Edits

/agent-key

Get the token of the Agent

 
posthttps://api.callhub.io/v2/agent-key/
# You'll need to install requests
import requests
data =   {"username":"abc", "password":"xyz"}
key = requests.post('https://api.callhub.io/v2/agent-key/', data=data)
print "Agent Key", key.json()
$.ajax({
	url: 'https://api.callhub.io/v2/agent-key/',
	data: {
		username: 'agentusername',
		password: 'agentpassword'
	},
	method: 'POST'
}).done(function(data) {
	console.log('Token is: ', data.token);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "token":"dew2rr4wedewddfwerwec43asdf"
}

Body Params

username
string

Username of the agent

password
string

Password of the agent

 
Suggest Edits

/agent-status

Get the current agent status

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v2/agent-status/
$.ajax({
  url: 'https://api.callhub.io/v2/agent-status/',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'GET'
}).done(function(data) {
  console.log('Current Agent Status: ', data);
  // ID of the campaign the agent has joined. If null, then agent has not joined a campaign
  // If this is not null, yet call_uuid is null, then agent is being called
  console.log('Agent is connecting to the campaign: ', data.connected_campaign);
  // If call_uuid is not null, agent is connected to the campaign
  console.log('Agent is connected to the campaign: ', data.call_uuid);
  // If current_subscriber is not null, agent is calling a subscriber
  console.log('Agent is calling a subscriber: ', data.current_subscriber);
  // If subscriber_uuid is not null, agent is currently on call with a subscriber
  console.log('Agent is on call with a subscriber: ', data.subscriber_uuid);
  // If supervisor_uuid is not null, a supervisor is connected to the call
  console.log('Agent is on call with a supervisor: ', data.supervisor_uuid);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "call_uuid": null,
  "connected_campaign": null,
  "current_subscriber": null,
  "subscriber_uuid": null,
  "supervisor_uuid": null
}
 

Fetch the current status of the agent here.

This API returns 5 properties. Each property signifies a different stage in the lifecycle of an agent connecting to a campaign and making calls.

If all of the properties are null, then the agent has not joined any campaign and is not on call.

Once the /conference api is used successfully to connect to a campaign, the connected_campaign field returns the ID of the connected campaign.

When the /conference/:id/agent api is used successfully to call the agent and the agent picks the call, the call_uuid returns the ID of the call.

After using /conference/:id/subscriber successfully to initiate a call with the subscriber, the current_subscriber field returns the ID of the subscriber being called.

After the subscriber picks up the call, subscriber_uuid returns the UUID of the call.

After using /conference/:id/supervisor to call the supervisor and the supervisor picks up the call, the supervisor_uuid returns the UUID of the supervisor's call.

Suggest Edits

/user-details

Get the details of the agent

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v2/user-details/
$.ajax({
  url: 'https://api.callhub.io/v2/user-details/',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'GET'
}).done(function(data) {
  console.log('Agent Details: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "user": {
    "first_name":"",
    "last_name":"",
    "email":"abc@callhub.io"
  },
  "agent": {
    "country":"US",
    "phone_no":"16508794561",
    "language":"en"
  }
}
 

This API returns details of the agent.

Field
Description

user.first_name

First name of the Agent

user.last_name

Last name of the Agent

user.email

Email of the agent

agent.country

Selected Country of the Agent

agent.phone_no

Phone Number of the agent. This phone number will be called when agent joins a campaign

agent.language

Language of the agent. Change this to change the language of the messages returned on success or failures of APIs

Suggest Edits

/user-details

Save details of the agent

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v2/user-details/
$.ajax({
  url: 'https://api.callhub.io/v2/user-details/',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'POST'
}).done(function(data) {
  console.log('Agent Details: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK  400 Bad Request
{
  "success_msg": "Detail successfully changed"
}
{
  "user_errors": [],
  "agent_errors": []
}

Body Params

user
object
 
user.first_name
string

First Name of the agent

user.last_name
string

Last Name of the agent

user.email
string

Email of the Agent

agent
object
 
agent.country
string

Country code of the country you want to set. Eg. United States is 'US, France is 'FR' and so on.

agent.phone_no
string

Phone Number of the agent

agent.language
string

Two character Language code of the language you want to set. Eg, English is 'en', French is 'fr'

 

This API can be used to save the details of the agent.

Suggest Edits

/password-change

Change the Password of the Agent

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v2/change-password/
$.ajax({
  url: 'https://api.callhub.io/v2/password-change/',
  data: {
    old_password: 'testing',
    new_password1: 'testing',
    new_password2: 'testing'
  },
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'POST'
}).done(function(data) {
  console.log('Password Change Status: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK  400 Bad Request
{
  "success_msg": "Your password has been changed"
}
{
  "errors": []
}

Body Params

old_password
string

The current password the agent is using

new_password1
string

The new password to be set

new_password_2
string

Repeat the new password the agent needs to set

 

Use this API to change the password of the agent

Suggest Edits

/sip-endpoint

Get the SIP endpoint details of the agent

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v2/sip-endpoint/
$.ajax({
  url: 'https://api.callhub.io/v2/sip-endpoint/',
  method: 'GET',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
}).done(function(data) {
  console.log('SIP Endpoint Details: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "username":"",
  "password":""
}
 

Use the SIP endpoint details in a SIP client to receive calls on the client.

Suggest Edits

/sip-endpoint

Get the SIP endpoint details of the agent

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v2/sip-endpoint/
$.ajax({
  url: 'https://api.callhub.io/v2/sip-endpoint/',
  method: 'POST',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
}).done(function(data) {
  console.log('SIP Endpoint Details: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK  400 Bad Request
{
  "username":"",
  "password":""
}
{
  "err_msg": "Oops! Something Went Wrong"
}
 
Suggest Edits

/nation-builder

Get the Agent's NationBuilder details

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v2/nation-builder/
$.ajax({
  url: 'https://api.callhub.io/v2/nation-builder/',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
	},
  method: 'GET'
}).done(function(data) {
  console.log('Agent NationBuilder data: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "data": {
    "nb_slug": null
  }
}
 

If the agent has connected their NationBuilder account to the CallHub account, then this API returns the slug of the nation that they have connected to.

Suggest Edits

/is-trophy

Get details of whether the agent is the best agent in that campaign and if not, who is

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v2/is-trophy/id/
// ID of a campaign the agent has been assigned to
var campaignid = 6;
$.ajax({
  url: 'https://api.callhub.io/v2/is-trophy/' + campaignid + '/',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'GET'
}).done(function(data) {
  console.log('Agent Campaign Trophy Status: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "trophy": false,
  "max_calls": 0,
  "best_agent": {},
  "curr_call_count": 0
}

Path Params

id
int32
required

ID of a campaign assigned to the agent

 

Check whether the agent is the best agent for that campaign and if not, get the details of the best agent.

Suggest Edits

/agent-campaigns

Get the IDs of all the campaigns the agent has been assigned to.

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v2/agent-campaigns/
$.ajax({
  url: 'https://api.callhub.io/v2/agent-campaigns/',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'GET'
}).done(function(data) {
  console.log('Agent Assigned Campaigns: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  campaigns: [456, 457, 458]
}
 

This API will return all the IDs of the campaigns that the agent has been assigned to.

Suggest Edits

/campaign-info

Details on the campaigns

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v2/campaign-info/
// Array of Campaign IDs. These can be fetched using the /v2/agent-campaigns API
var campaigns = [6, 7];
$.ajax({
	url: 'https://api.callhub.io/v2/campaign-info/?id=' + JSON.stringify(campaigns),
	headers: {
		'Authorization': 'Token ' + token
	},
	method: 'GET'
}).done(function(data) {
	console.log('Agent Campaigns Info: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "campaign_info": [
    {
      "status": 4,
      "assign_agents": true,
      "code": null,
      "name": "CallCenter Campaign, Aug 04, 22:29",
      "script": "Something",
      "invite_person": false,
      "incomingid": null,
      "totalcontact": 5,
      "team": null,
      "completed": 1,
      "voicemail_audiofile": null,
      "recording": true,
      "phonebook": [
        3
      ],
      "pending_notes": false,
      "created_date": "2016-08-05T05:29:50.855Z",
      "notes_required": false,
      "voicemail_detection": false,
      "id": 6
    }
  ]
}

Query Params

id
array of integers

Array of Campaign IDs

 

This API can be used to fetch the informations of the campaigns the agent has been assigned to. Use the /agent-campaigns API to fetch all the assigned campaigns.

This returns an array of Campaign-Info objects, each containing information about the campaign.

Property
Description

status

assign_agents

code

name

script

invite_person

incoming_id

totalcontact

team

completed

voicemail_audiofile

recording

phonebook

pending_notes

created_date

notes_required

voicemail_detection

id

Suggest Edits

/script-sections/:id

Get the script sections assigned to a campaign

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v2/script-sections/id
# You'll need to install requests
import requests
# api_key can be found by using /v2/agent-key API
headers = {'Authorization': 'Token %s' % api_key}
# replace campaign_id with the id number of the campaign for which script you are fetching
url = 'https://api.callhub.io/v2/script-sections/%d/'% campaign_id
r = requests.get(url, headers=headers)
print "Script information in JSON", r.json()
// This is the campaign the agent is getting the script for
var campaign_id = 6;
$.ajax({
  url: 'https://api.callhub.io/v2/script-sections/' + campaign_id + /,
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'GET'
}).done(function(data) {
  console.log('Campaign Survey Sections: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "script_sections": [
    {
      "is_bound": false,
      "non_field_errors": [],
      "errors": {},
      "title": "MultiChoiceSurvey",
      "fields": {
        "question": {
          "widget": {
            "needs_multipart_form": false,
            "title": "RadioSelect",
            "input_type": "radio",
            "choices": [
              {
                "name": "question",
                "value": 12817,
                "display": "NO_ANSWER"
              },
              {
                "name": "question",
                "value": 12818,
                "display": "MACHINE"
              },
              {
                "name": "question",
                "value": 12819,
                "display": "DO_NOT_CALL"
              },
              {
                "name": "question",
                "value": 12820,
                "display": "ANSWER"
              }
            ],
            "is_localized": false,
            "attrs": { "disabled": true },
            "is_hidden": false,
            "is_required": false
          },
          "required": false,
          "title": "ChoiceField",
          "initial": null,
          "label": "Set Call Disposition:",
          "choices": [
            {
              "display": "NO_ANSWER",
              "value": 12817
            },
            {
              "display": "MACHINE",
              "value": 12818
            },
            {
              "display": "DO_NOT_CALL",
              "value": 12819
            },
            {
              "display": "ANSWER",
              "value": 12820
            }
          ],
          "help_text": "",
          "error_messages": {
            "required": "This field is required.",
            "invalid_choice": "Select a valid choice. %(value)s is not one of the available choices.", "invalid": "Enter a valid value."
          }
        }
      },
      "ordered_fields": ["question"],
      "label_suffix": ":",
      "prefix": 24528,
      "data": { "question": null },
      "fieldsets": []
    },
    {
      "is_bound": false,
      "non_field_errors": [],
      "errors": {},
      "title": "MultiChoiceSurvey",
      "fields": {
        "question": {
          "widget": {
            "needs_multipart_form": false,
            "title": "RadioSelect",
            "input_type": "radio",
            "choices": [
              {"name": "question",
                "value": 12821,
                "display": "Bad"
              },
              {
                "name": "question",
                "value": 12822,
                "display": "Good"
              }
            ],
            "is_localized": false,
            "attrs": { "disabled": true },
            "is_hidden": false,
            "is_required": false
          },
          "required": false,
          "title": "ChoiceField",
          "initial": null,
          "label": "Hello how are you?",
          "choices": [
            {
              "display": "Bad",
              "value": 12821
            },
            {
              "display": "Good",
              "value": 12822
            }
          ],
          "help_text": "",
          "error_messages": {
            "required": "This field is required.",
            "invalid_choice": "Select a valid choice. %(value)s is not one of the available choices.",
            "invalid": "Enter a valid value."
          }
        }
      },
      "ordered_fields": ["question"],
      "label_suffix": ":",
      "prefix": 24529,
      "data": { "question": null },
      "fieldsets": []
    },
    {
      "is_bound": false,
      "non_field_errors": [],
      "errors": {},
      "title": "NotesSurvey",
      "fields": {
        "question": {
          "min_length": null,
          "widget": {
            "needs_multipart_form": false,
            "title": "Textarea",
            "input_type": "textarea",
            "is_localized": false,
            "attrs": {
              "disabled": true,
              "rows": 3,
              "cols": "40",
              "class": "span10"
            },
            "is_hidden": false,
            "is_required": false
          },
          "required": false,
          "title": "CharField",
          "initial": null,
          "label": "Notes",
          "max_length": null,
          "help_text": "",
          "error_messages": {
            "required": "This field is required.",
            "invalid": "Enter a valid value."
          }
        },
        "bleg_uuid": {
          "min_length": null,
          "widget": {
            "needs_multipart_form": false,
            "title": "HiddenInput",
            "input_type": "hidden",
            "is_localized": false,
            "attrs": { "class": "bleg_uuid" },
            "is_hidden": true,
            "is_required": false
          },
          "required": false,
          "title": "CharField",
          "initial": "", "label": null,
          "max_length": null,
          "help_text": "",
          "error_messages": {
            "required": "This field is required.",
            "invalid": "Enter a valid value."
          }
        }
      },
      "ordered_fields": ["question", "bleg_uuid"],
      "label_suffix": ":",
      "prefix": 24530,
      "data": {
        "question": null,
        "bleg_uuid": ""
      },
      "fieldsets": []
    }
  ]
}

Path Params

id
int32
required

Id of the campaign.

 

The API provides the script and survey questions of the campaign. Using the response of this API the script/survey page of the call center can be designed.

Suggest Edits

/script-answers/:id

Post answers to survey questions

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v2/script-answers/id
# You'll need to install requests
import requests
# api_key can be found by using /v2/agent-key API
headers = {'Authorization': 'Token %s' % api_key}
# 24310 or 24129 is the Id of the question which will be obtained from script-sections API
data = {'24130-question':12482, '24129-question':12476, '24131-question':'notestanswer by Fate1'}
# join this conference
r=requests.post('https://api.callhub.io/v2/script-answers/%s/'%campaign_id,data=data,headers=headers)
print 'Posted subscriber notes' , r.json()
// This is the campaign the agent is currently connected to
var campaign_id = 6;
// The field name is a combination of the prefix for a field obtained from the /v2/script-sections/ api and the string ‘-question’
var script_answers = {
  ‘1234-question’: ‘Answer’,
  ‘1235-question’: 1	
};
$.ajax({
  url: 'https://api.callhub.io/v2/script-sections/' + campaign_id + /,
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'GET'
}).done(function(data) {
  console.log('Campaign Survey Answers Submit: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "success_msg":"Survey submitted succesfully"
}

Path Params

id
int32
required

script campaign id.

 

Post answers to the script and survey questions

Suggest Edits

/current-subscriber/:id

Get the details of the current subscriber called

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v2/current-subscriber/id
# You'll need to install requests
import requests
# api_key can be found by login as agent and getting the api token.
headers = {'Authorization': 'Token %s' % api_key}
# replace campaign_id with the id number of the campaign for which current subscriber information you are fetching
url = 'https://api.callhub.io/v2/current-subscriber/%d/'% campaign_id
r = requests.get(url, headers=headers)
print "Subscriber information in JSON", r.json()
// This is the campaign the agent is currently connected to
// Use this api after calling the subscriber to fetch their information
var campaign_id = 6;
$.ajax({
  url: 'https://api.callhub.io/v2/current-subscriber/' + campaign_id + /,
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'GET'
}).done(function(data) {
  console.log('Connected Subscriber Information: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "crm_vars": null, 
  "last_name": "Latimer", 
  "household": [], 
  "city": "", 
  "first_name": "Fanny", 
  "zipcode": "", 
  "state": "", 
  "company_name": "", 
  "unit_number": "", 
  "job_title": "", 
  "updated_date": "2016-06-14T20:13:35.220Z", 
  "oldphonebook": null, 
  "description": "", 
  "household_obj": null, 
  "additional_vars": null, 
  "company_website": "", 
  "user": 1800, 
  "address": "", 
  "mobile": "14015231440", 
  "country": "", 
  "email": "", 
  "contact": "14015231441", 
  "status": 1, 
  "created_date": "2016-06-14T20:12:25.797Z"
}

Path Params

id
int32
required

Id of the campaign which the subscriber is part of.

 
Suggest Edits

/subscriber-history/:id

Get the history for a subscriber

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v2/subscriber-history/id
# You'll need to install requests
import requests
# api_key can be found by using /v2/agent-key API
headers = {'Authorization': 'Token %s' % api_key}
# replace campaign_id with the id number of the campaign for which current subscriber information you are fetching
url = 'https://api.callhub.io/v2/subscriber-history/%d/'% campaign_id
r = requests.get(url, headers=headers)
print "Subscriber history in JSON", r.json()
// This is the campaign the agent is currently connected to
// Use this api after calling the subscriber to fetch their information
var campaign_id = 6;
$.ajax({
  url: 'https://api.callhub.io/v2/subscriber-history/' + campaign_id + /,
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'GET'
}).done(function(data) {
  console.log('Connected Subscriber History: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "callcenter": {
    "Chris Gomes": [
      {
        "response_text": null, 
        "response_notes": "notestanswer", 
        "response_choice": null, 
        "timestamp": "2016-06-15T20:54:24.278Z", 
        "question": "Notes", 
        "question_type": 4, 
        "response_digit": null, 
        "id": 506373
      }, 
      {
        "response_text": null, 
        "response_notes": null, 
        "response_choice": "DO_NOT_CALL", 
        "timestamp": "2016-06-15T20:54:23.970Z", 
        "question": "Set Call Disposition:", 
        "question_type": 6, 
        "response_digit": null, 
        "id": 506372
      }, 
    ]
  }, 
  "voice": [], 
  "sms": []
}

Path Params

id
int32
required

Campaign id of which the subscriber is part of.

 

Lists all the available voice,sms and call center history about the current contact being called in the call center campaign.

Suggest Edits

/conference

Create a conference object

 

Authentication

 Authentication is required for this endpoint.
posthttps://api.callhub.io/v2/conference/
# You'll need to install requests
import requests
# api_key can be found by using /v2/agent-key API
headers = {'Authorization': 'Token %s' % api_key}
data =  {'campaign_id': '%d'%campaign_id}
conf = requests.post('https://api.callhub.io/v2/conference/', data=data, headers=headers)
print "Conference object created ", conf.json()
$.ajax({
  url: 'https://api.callhub.io/v2/conference/',
  data: {
    // Campaign ID of the campaign the agent is joining
    campaign_id: 6
  },
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'POST'
}).done(function(data) {
  console.log('Conference Details: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "recording": False, 
  "current_subscriber": None, 
  "supervisor": None, 
  "member_count": 0, 
  "voicemail": False, 
  "campaign_id": 1463, 
  "agent": None, 
  "conference_uuid": "bcd6db96-ed5c-4581-b26e-d49d089fa5fd", 
  "subscriber": [], 
  "manager": None, 
  "active": False, 
  "last_updated": "2016-07-13T20:58:26.284659Z", 
  "created_at": "2016-07-13T20:58:26.284653Z", 
  "notes_required": True, 
  "id": "9786ab72f8c1fd62d4368fae"
}

Body Params

campaign_id
int32
required

Id of campaign for which the conference is created.

 

Create a new conference object for agent to join the campaign.

Use the conference_uuid property in the returned object for all subsequent conference calls such as /conference/:id/agent, /conference/:id/subscriber etc.

Suggest Edits

/conference/:id

Get a conference object

 

Authentication

 Authentication is required for this endpoint.
gethttps://api.callhub.io/v2/conference/
# You'll need to install requests
import requests
# api_key can be found by using /v2/agent-key API
headers = {'Authorization': 'Token %s' % api_key}
data =  {'campaign_id': '%d'%campaign_id}
conf = requests.post('https://api.callhub.io/v2/conference/', data=data, headers=headers)
print "Conference object created ", conf.json()
// This value is the conference_uuid value returned when creating a conference using /v2/conference
var conference_uuid = “aabbccdd”;
$.ajax({
  url: 'https://api.callhub.io/v2/conference/' + conference_uuid + '/',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'GET'
}).done(function(data) {
  console.log('Conference Details: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "recording": False, 
  "current_subscriber": None, 
  "supervisor": None, 
  "member_count": 0, 
  "voicemail": False, 
  "campaign_id": 1463, 
  "agent": None, 
  "conference_uuid": "bcd6db96-ed5c-4581-b26e-d49d089fa5fd", 
  "subscriber": [], 
  "manager": None, 
  "active": False, 
  "last_updated": "2016-07-13T20:58:26.284659Z", 
  "created_at": "2016-07-13T20:58:26.284653Z", 
  "notes_required": True, 
  "id": "9786ab72f8c1fd62d4368fae"
}

Body Params

campaign_id
int32
required

Id of campaign for which the conference is created.

 

Get the conference object created by the agent using a conference_uuid.

Suggest Edits

/conference/:id/agent

Join agent to the conference

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v2/conference/id/agent/
# You'll need to install requests
import requests
# api_key can be found by using /v2/agent-key API
# First create a conference
headers = {'Authorization': 'Token %s' % api_key}
data =  {'campaign_id': '%d'%campaign_id}
conf = requests.post('https://api.callhub.io/v2/conference/', data=data, headers=headers)
conf_uuid = conf.json()['conference_uuid']

# Then join the above conference
# p_connection is connection preference of agent. like 'PHONE'
join_data = {'endpoint':p_connection} 
r=requests.put('https://api.callhub.io/v2/conference/%s/agent/'%conf_uuid,data=join_data,headers=headers)
print 'Agent joined Conference' , r.json()
// This value is the conference_uuid value returned when creating a conference using /v2/conference
var conference_uuid = “aabbccdd”;
$.ajax({
  url: 'https://api.callhub.io/v2/conference/' + conference_uuid + '/agent/',
  data: {
    'endpoint': 'PHONE'
  },
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'PUT'
}).done(function(data) {
  console.log('Agent joined Successfully: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "success_msg": "Your phone number will be called in a few seconds"
}

Path Params

id
string
required

The uuid of the conference that the Agent is joining.

Body Params

endpoint
string
required

Connection preference of the Agent.

 

Agent joins the conference through API to start making calls for the campaign.

Suggest Edits

/conference/:id/agent

Hangup the agent

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v2/conference/id/agent/
# You'll need to install requests
import requests
# api_key can be found by using /v2/agent-key API
headers = {'Authorization': 'Token %s' % api_key}

# hangup the conference
# p_connection is connection preference of agent. It can be 'PHONE', 'SIP'
data = {'endpoint':p_connection} 
r=requests.delete('https://api.callhub.io/v2/conference/%s/agent/'%conf_uuid,data=data,headers=headers)
print 'Agent left Conference' , r.json()
// This value is the conference_uuid value returned when creating a conference using /v2/conference
var conference_uuid = “aabbccdd”;
$.ajax({
  url: 'https://api.callhub.io/v2/conference/' + conference_uuid + '/agent/',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'DELETE'
}).done(function(data) {
  console.log('Agent Leaving Conference: ', data);
});

{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "success_msg": "Session Ended"
}

Body Params

endpoint
string
 
Suggest Edits

/conference/:id/subscriber

Make call to next subscriber

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v2/conference/id/subscriber/
# You'll need to install requests
import requests
# api_key can be found by using /v2/agent-key API
# First create a conference
headers = {'Authorization': 'Token %s' % api_key}
data =  {'campaign_id': '%d'%campaign_id}
conf = requests.post('https://api.callhub.io/v2/conference/', data=data, headers=headers)
conf_uuid = conf.json()['conference_uuid']

# Then join this conference
# p_connection is connection preference of agent like 'PHONE'
join_data = {'endpoint':p_connection} r=requests.put('https://api.callhub.io/v2/conference/%s/agent/'%conf_uuid,data=join_data,headers=headers)

# Call the next available subscriber in the list
s=requests.put('https://api.callhub.io/v2/conference/%s/subscriber/'%conf_uuid,headers=headers)
print 'Subscriber called' , s.json()
// This value is the conference_uuid value returned when creating a conference using /v2/conference
var conference_uuid = “aabbccdd”;
$.ajax({
  url: 'https://api.callhub.io/v2/conference/' + conference_uuid + '/subscriber/',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'PUT'
}).done(function(data) {
  console.log('Calling Next Subscriber: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "success_msg": "Call Connected"
}

Path Params

id
string
required

The uuid of the conference.

 

The API is used to call the next available subscriber in the contact list of the call center campaign.

Suggest Edits

/conference/:id/subscriber/voicemail

Drop voicemail to subscriber

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v2/conference/id/subscriber/voicemail/
# You'll need to install requests
import requests
# api_key can be found by using /v2/agent-key API
headers = {'Authorization': 'Token %s' % api_key}

# Drop voicemail to the subscriber when machine picks up
r=requests.put('https://api.callhub.io/v2/conference/%s/subscriber/voicemail/'%conference_uuid,headers=headers)
print 'Voicemail dropped to subscriber' , r.json()
// This value is the conference_uuid value returned when creating a conference using /v2/conference
var conference_uuid = “aabbccdd”;
$.ajax({
  url: 'https://api.callhub.io/v2/conference/' + conference_uuid + '/subscriber/voicemail/',
  headers: {
    'Authorization': 'Token ' + token
  },
  method: 'PUT'
}).done(function(data) {
  console.log('Dropping Voicemail: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "success_msg": "Voicemail Dropped"
}
 

Drop voicemail to the subscriber. Calling this API hangs up the call and leaves a message selected by the campaign manager when creating a campaign.

Suggest Edits

/conference/:id/subscriber

Hangup subscriber

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v2/conference/id/subscriber/
# You'll need to install requests
import requests
# api_key can be found by using /v2/agent-key API
headers = {'Authorization': 'Token %s' % api_key}

# Hangup the subscriber when ringing or when conversation is complete
r=requests.delete('https://api.callhub.io/v2/conference/%s/subscriber/'%conf_uuid,headers=headers)
print 'Subscriber left Conference' , r.json()
// This value is the conference_uuid value returned when creating a conference using /v2/conference
var conference_uuid = “aabbccdd”;
$.ajax({
  url: 'https://api.callhub.io/v2/conference/' + conference_uuid + '/subscriber/',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'DELETE'
}).done(function(data) {
  console.log('Hanging Up Subscriber: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "success_msg": "Call Disconnected"
}
 
Suggest Edits

/conference/:id/supervisor

Call a phone number to a third party who will join the call with the subscriber

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v2/conference/id/supervisor/
// This value is the conference_uuid value returned when creating a conference using /v2/conference
var conference_uuid = "aabbccdd";
// This is the phone number of the supervisor that you wish to call
var supervisorNumber = "123456789";
$.ajax({
  url: 'https://api.callhub.io/v2/conference/' + conference_uuid + '/supervisor/',
  data: {
		'contact': supervisorNumber
	},
	headers: {
    // Use the token obtained from /v2/agent-key api
		'Authorization': 'Token ' + token
	},
	method: 'PUT'
}).done(function(data) {
	console.log('Calling Supervisor: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK  400 Bad Request
{
  "success_msg": "Supervisor will be called in a few seconds"
}
{
  "err_msg": "Invalid Phone Number"
}

Path Params

id
string
required

Conference UUID obtained when creating the conference

 
Suggest Edits

/conference/:id/subscriber/transfer

Hand over a call with the subscriber to the supervisor

 

Authentication

 Authentication is required for this endpoint.
puthttps://api.callhub.io/v2/conference/id/subscriber/transfer/
// This value is the conference_uuid value returned when creating a conference using /v2/conference
var conference_uuid = "aabbccdd";
// This is the phone number of the supervisor that you wish to call
var supervisorNumber = "123456789";
$.ajax({
  url: 'https://api.callhub.io/v2/conference/' + conference_uuid + '/supervisor/transfer/',
  data: {
		'contact': supervisorNumber
	},
	headers: {
    // Use the token obtained from /v2/agent-key api
		'Authorization': 'Token ' + token
	},
	method: 'PUT'
}).done(function(data) {
	console.log('Calling Supervisor: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK  400 Bad Request
{
  "success_msg": "Call transferred to supervisor"
}
{
  "err_msg": "Subscriber not connected to this campaign"
}

Path Params

id
string
required

Conference UUID obtained when creating the conference

 

After the supervisor joins the call, the agent can hand over the call to the supervisor and leave the call. This allows the agent to move onto the next call with the call between the Supervisor and the Subscriber still ongoing.

Suggest Edits

/conference/:id/supervisor

Hangup supervisor from the conference

 

Authentication

 Authentication is required for this endpoint.
deletehttps://api.callhub.io/v2/conference/id/supervisor/
# You'll need to install requests
import requests
# api_key can be found by using /v2/agent-key API
headers = {'Authorization': 'Token %s' % api_key}

# hangup the subscriber
r=requests.delete('https://api.callhub.io/v2/conference/%s/subscriber/'%conf_uuid,headers=headers)
print 'Supervisor left Conference' , r.json()
// This value is the conference_uuid value returned when creating a conference using /v2/conference
var conference_uuid = “aabbccdd”;
$.ajax({
  url: 'https://api.callhub.io/v2/conference/' + conference_uuid + '/supervisor/',
  headers: {
    // Use the token obtained from /v2/agent-key api
    'Authorization': 'Token ' + token
  },
  method: 'DELETE'
}).done(function(data) {
  console.log('Hanging Up Subscriber: ', data);
});
{{ results.method }}
{{ results.url }}
{{ results.requestHeaders }}
{{ results.data }}
{{ results.responseHeaders }}
     200 OK
{
  "success_msg": "Supervisor Dropped"
}
 

The supervisor will be removed from the conference and the agent will once again be only connected to the subscriber