python-intercom
A python API for Intercom’s API.
Examples
from intercom.client import Client
intercom = Client("<personal-access-token>")
Get a User
user = intercom.users.find(email='somebody@example.com')
Get a Company
company = intercom.companies.find(name="ACME Ltd.")
Start a conversation
# user starts a conversation by sending a message
message_data = {
'from': {
'type': "user",
'id': "536e564f316c83104c000020"
},
'body': "Never gonna ... forget about it."
}
intercom.messages.create(**message_data)
Reply to a conversation
# admin replies
conversation = intercom.conversations.find(id='10037')
intercom.conversations.reply(
id=conversation.id,
type='admin',
admin_id='383',
message_type='comment',
body='Aw, I love that song.')