Skip to content

Instantly share code, notes, and snippets.

@chetangiridhar
Created December 10, 2015 17:10
Show Gist options
  • Save chetangiridhar/12ff0b1430b2c0431c72 to your computer and use it in GitHub Desktop.
Save chetangiridhar/12ff0b1430b2c0431c72 to your computer and use it in GitHub Desktop.
CallHub API: Add Contact to given Phonebook
import requests
url = "https://api.callhub.io/v1/contacts/"
data = {"contact":"+11234567891","phonebook":"https://api.callhub.io/v1/phonebooks/123456/", "first_name":"Chetan"}
headers = {"Authorization": "Token <YOUR_API_KEY>"}
r = requests.post(url, data=data, headers=headers)
print r, r.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment