Skip to content

Instantly share code, notes, and snippets.

@looneym
Created December 3, 2016 15:15
Show Gist options
  • Save looneym/77e5c3c752055a677829ae24c8639a04 to your computer and use it in GitHub Desktop.
Save looneym/77e5c3c752055a677829ae24c8639a04 to your computer and use it in GitHub Desktop.
How to use a personal access token with the (unofficial) Python SDK
from intercom import Intercom, User
# Standard configuration using an app_id and API Key
Intercom.app_id = "my_app_id"
Intercom.app_api_key = "my-super-secret-api-key"
# Usng a Personal Access Token (jus replace the app_id and leave the key blank)
Intercom.app_id = "my-super-secret-PAT"
# Do whatever
user = User.find(email="bob@example.com")
# Pro Tip: Set your PAT as an environment in your .bashrc:
# export INTERCOM_PAT="PAT-goes-here"
# And use it in your Python program:
Intercom.app_id = os.environ['INTERCOM_PAT']
@CleverProgrammer
Copy link

Oh I already got this up and running last night! Thanks so much! Did not know the pro tip though

@CleverProgrammer
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment