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

Can I assign / update the Owner for a user?

Open paulbeelen opened this issue 5 years ago • 2 comments

I'm wondering if I can assign or change the Owner associated with a user. I assume it's an attribute but not sure what it's called, unable to find it... Thanks for any help!

paulbeelen avatar May 28 '19 14:05 paulbeelen

I've been trying to find a way to do this, and it looks like the answer is NO. API v1.4 (which is required for this SDK) does not support updating the owner. Trying to hack around it, for example by adding the owner_id (or owner) field into custom attributes, does nothing other than create a new custom attribute (leaving the actual owner unaffected).

bikegriffith avatar Feb 04 '21 21:02 bikegriffith

You can dip back into the REST API if you need to, for example:

contact = intercom.users.find(user_id='2605')
resp = requests.put('https://api.intercom.io/contacts/'+contact.id,
        json={'owner_id': new_owner_id},
        headers={
            'Authorization': 'Bearer <<your token here>>,
            }
        )

bikegriffith avatar Feb 04 '21 21:02 bikegriffith