When this was made, the python-intercom package was wildly out of date and didn't seem to be getting updates. It is now functional again and should be used instead.
https://github.com/intercom/python-intercom
This is an unofficial Python SDK for interacting with the Intercom API as defined in the Intercom API Reference. This project is in no way associated with Intercom and is provided as-is without warranty. See the LICENSE file for more information.
All functionality to the SDK is provided through a single Intercom class which can be imported as follows:
fromintercom_python_sdkimportIntercomThe most basic way to authenticate with the SDK is to provide an API Key (Private App Key) as follows:
importintercom_python_sdkintercom=intercom_python_sdk.Intercom(api_key='my_api_key')You can then access all sub-APIs through this object, like so:
cur_admin=intercom.admins.me()
all_admins=intercom.admins.list_admins()
all_data_events=intercom.data_events.list_all()The Intercom class can support being passed a Configuration object. This class itself will expect you to manually build your Authentication object from the Uplink library, and gives you access to some additional settings.
fromuplink.authimportBearerTokenfromintercom_python_sdkimportIntercom, Configurationauth=BearerToken('my_api_key')
config=Configuration(
auth=auth, base_url='https://api.intercom.io',
api_version="2.9",
proxy={'https': 'https://127.0.0.1:8080'} # Optional Proxy for Debug-- see requests.Session proxy documentation
)
intercom=Intercom(config=config)For developers, additional parameters from the underlying library (Uplink) are exposed here as well. See the docstrings for more information.
You also have the ability to create individual clients for a specific API instead of using the Intercom class. This may be useful if you have different credentials for different APIs, or if you want to use the same credentials but different configurations.
fromintercom_python_sdkimportAdmins, Configuration, create_api_client, API_TAGSauth=BearerToken('my_api_key')
config=Configuration(auth=auth)
admins=create_api_client(API_TAGS["admin"], config)