Skip to content

Instantly share code, notes, and snippets.

@looneym
Created November 28, 2016 13:13
Show Gist options
  • Save looneym/879fe6458a4499e862e61f0dc6767f16 to your computer and use it in GitHub Desktop.
Save looneym/879fe6458a4499e862e61f0dc6767f16 to your computer and use it in GitHub Desktop.
Using the request library with the Intercom REST API.
import requests
import urllib
import commentjson
"""
Install dependancies with:
pip install commentjson requests
"""
email = ""
INTERCOM_VIEW_USER = "https://api.intercom.io/users?"
INTERCOM_PAT = ""
r = requests.get(INTERCOM_VIEW_USER + 'email=' + urllib.quote_plus(email), auth=(INTERCOM_PAT,""), headers={"Accept":"application/json"})
response = commentjson.loads(r.text)
print response["email"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment