How can I clear the external_id field on my users? | Community
Skip to main content
Answered

How can I clear the external_id field on my users?

  • June 3, 2021
  • 7 replies
  • 191 views

API 2.3 via PHP+cURL:

 

I can SET or CHANGE the external_id but any attempt to set the external_id to empty posting {'external_id':''} to https://api.intercom.io/contacts/... is returned with a 200 OK but the external_id retains the former value.

 

I have tried with '' and null to no avail.

 

 

Best answer by Roy

Hi @marcos s11​ , Welcome to Interconnect

 

In case to remove external_id from contact, you should use update contact API. here's the example:

 

Request: PUT https://api.intercom.io/contacts/ContactID/p>{ "external_id": "null" }

I hope this will be helpful, let me know if there any further questions about this topic.

7 replies

Roy
Top Expert ✨
Forum|alt.badge.img+5
  • Top Expert ✨
  • Answer
  • June 3, 2021

Hi @marcos s11​ , Welcome to Interconnect

 

In case to remove external_id from contact, you should use update contact API. here's the example:

 

Request: PUT https://api.intercom.io/contacts/ContactID/p>{ "external_id": "null" }

I hope this will be helpful, let me know if there any further questions about this topic.


  • Author
  • New Participant
  • June 4, 2021

Hi @roy s11​ 

 

Thank you for your response but that doesn't work either:

$r = $i->contactUpdate($contact_id, ['external_id' => 'null']);

returns

array ( 'type' => 'contact', 'id' => '60b60638a6804d0e97c0cecc', ... 'external_id' => 'null', ...

so it is using null quite literally as a string, not the expected value there of.

 

As I have stated before, I would expect it to work without the quotes as in

{"external_id":null}

but it returns a 200 OK and

array ( 'type' => 'contact', 'id' => '60b636230b087269d2d36979', ... 'external_id' => '16120', ...

 


  • Author
  • New Participant
  • June 4, 2021

Just for the sake of clarity, using the following JetBrains REST client configuration I get the same results so it is not the PHP library that is miss behaving

PUT https://api.intercom.io/contacts/60b636230b087269d2d36979 Authorization:Bearer <my-token> Intercom-Version: 2.3 Content-Type: application/json Accept: application/json   { "external_id": null }

 


  • Author
  • New Participant
  • June 4, 2021

Just for good measure... in production I have identical behavior.


  • Connector
  • November 9, 2022

any update on this?


  • Connector
  • November 9, 2022

this doesn't work, the value becomes "null" instead of null (and as unknown in the gui)


  • New Participant
  • January 1, 2024

Is there an update on this? The answer provided does not work.