python-intercom icon indicating copy to clipboard operation
python-intercom copied to clipboard

Unable to save custom attributes (bad 'pages' parameter)

Open paulbeelen opened this issue 6 years ago • 1 comments

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.

paulbeelen avatar May 27 '19 19:05 paulbeelen

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"])

jleclanche avatar Feb 16 '22 19:02 jleclanche