Skip to main content

I'm trying to update a contact (type = 'user') through the API, and want to populate the User ID field. I found out that in the API, this is called the External ID (which is somewhat confusing, and the docs aren't clear).

 

I have 2 scenarios:

Scenario 1 - all good

I create a contact through the API and directly set the External ID. The External ID shows up in the User ID field as expected. I can change this via a new API request if needed.

 

Scenario 2: 400 - Bad request

I create a contact through the API without setting an External ID. This works. Now, I want to update this contact and set the external ID. I get a 400 - Bad request without further details.

 

If I remove the External ID field from the API request, everything works and I get a 200 response.

 

I'm stuck with scenario 2, because I need to update contacts that I sent through the API earlier, without an external id.

 

More info

In both scenarios I'm making a post request and supply the Intercom ID of the contact, as well as the User Hash.

@roy s11​, do you have any idea what might be causing this?


I am also facing exact same issue. do you know any workarounds ?


Hey @user147​ Racheal from the support engineer team here👋 

 

How close together are you making these create and update calls? If they are too close together the user might not be created yet and we can't find a user to update. When you say you leave the external ID out and it works, what other data is being sent through?


@racheal​  since I am also experiencing the same issue more recently. I can confirm that these calls 1. creating a contact without external_id and 2. Updating contact for external_id are made with significant delay. 2 to 3 days later.

for your second question, I am sending some basic fields and a few custom fields as well


Hey @rasikh​ Sorry I didn't tag you there!

 

That is odd, I'm not running into any trouble updating a contacts external_id, even if it was unknown previously. To walk you through my steps, I create the user using the create user endpoint:

Screenshot 2022-12-14 at 10.06.07 PMI then grab that id and make an update call, to update the external_id:

Screenshot 2022-12-14 at 10.07.10 PMA couple questions here- can you confirm that you are setting the appropriate headers? Additionally, are you creating/updating a lead or user?


Reply