Skip to main content

Python API Wrapper for the CallHub API

Project description

CallHub Python Wrapper

Build Status Coverage Status PyPI version

CallHub API Client Wrapper for Python

Creates a clean(er) python interface to several important functions of the CallHub API.

project-logo

Installation

pip install callhub-python-wrapper

Requires Python 3.5 or higher

Features

  • Built-in (optional) ratelimiting that respects CallHub's varying rate limits for different functions
  • Better error handling for uploading contacts with fields that don't exist in CallHub
  • Abstracted away some tedious parts of using CallHub's API. When uploading contacts, CallHub wants you to map CSV columns to the ids of each field in CallHub, which is difficult and easy to mess up. This wrapper handles all of that by matching on field names.
  • Automatically handles paging when doing bulk fetching
  • Uses async requests to improve speed for repetitive calls (implemented in get_contacts)

Currently implemented

  • Bulk create contacts
  • Get agent leaderboard
  • Get all fields and IDs (including custom fields)
  • Bulk get contacts and fields
  • Create single contact

Currently on roadmap

  • Create phonebook
  • Add/delete/get contacts to/from DNC list
  • Create/get/delete webhook
  • Create/get teams
  • Add/delete agent to/from team
  • Create/delete agent

Usage

import callhub
callhub = CallHub(api_key="123456789ABCDEF")
phonebook_id = 6545324
contacts = [{'first name': 'Sumiya', 'phone number':'5555555555', 'mobile number': '5555555555'},
           {'first name': 'Joe', 'phone number':'5555555555', 'mobile number':'5555555555'}]
country_iso = "CA"

# Create multiple contacts
callhub.bulk_create(phonebook_id, contacts, country_iso)

# Create single contact
callhub.create_contact(contacts[0])

# Get all contacts (up to a user-specified limit)
callhub.get_contacts(1000000)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

callhub-python-wrapper-0.1.2.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

callhub_python_wrapper-0.1.2-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page