Created
November 28, 2016 13:13
-
-
Save looneym/879fe6458a4499e862e61f0dc6767f16 to your computer and use it in GitHub Desktop.
Using the request library with the Intercom REST API.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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