intercom / python-intercom

Python wrapper for the Intercom API.

Home Page:https://keyes.ie/things/python-intercom/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error updating leads

BradleyKirton opened this issue · comments

Hi there!

I am posting here to find out if there are any other users of this library which are experiencing errors when updating a lead.

lead = client.leads.find(id="valid-lead-id-here")  # This returns successfully

lead.updated_at = 1715691332
client.leads.save(lead)  # This returns an API exception

The library raises an exception ResourceNotFound: The requested resource does not exist; check your path and try again.

The underlying HTTP response is as follows.

{'errors': [{'code': 'not_found', 'message': 'The requested resource does not exist; check your path and try again'}], 'type': 'error.list'}

I have looked at the code and the library is issuing a PUT request for the update. We are using version 1.4 of the API which now states to update a POST request should be used.

https://developers.intercom.com/docs/references/1.4/rest-api/leads/update-lead/

We are going to resolve this locally by issuing a POST request to the contacts resource, I thought I would write here in case there are others experiencing this issue.