python-intercom
python-intercom copied to clipboard
Unable to save custom attributes (bad 'pages' parameter)
I'm trying to update a user but I'm getting the following error: BadRequestError: bad 'pages' parameter
What I'm doing is the following:
user = intercom.users.find(email="[email protected]")
user.custom_attributes['firstName'] = 'Bob'
intercom.users.save(user)
Any ideas why this is not working?
UPDATE: I have been able to get this to work with id (intercom's id) and user_id (id assigned by us) but still not with email.
When searching with email=, the response returned is a collection instead of a single user. It's super weird. You can do something like this:
intercom_users = intercom.users.find(email="[email protected]")
intercom_user = intercom.users.find(id=intercom_users.users[0]["id"])