Skip to main content
Answered

How to migrate API from v.2.10.4 to 4.0.0


Hej,

 

currently we are using the intercom-client v.2.10.4 to create a new contact with the role 'user'.

In the version 4.0.0 the API has changed but I cannot create a user with the call 'client.contacts.createUser'.

How can I migrate our project so, I can use the latest version of the intercom client?

Best answer by Oseas

Hey @user1622​ ! Oséas here from the Customer Support Specialist team 🕵️

 

Here's our migration guide. In the latest version, you should still be able to create a user by calling client.contacts.createUser. Here's an example:

const user = await client.contacts.createUser({
externalId: '536e564f316c83104c000020',
phone: '+48370044567',
name: 'Niko Bellic',
avatar: 'https://nico-from-gta-iv.com/lets_go_bowling.jpg#39;,
signedUpAt: 1638203719,
lastSeenAt: 1638203720,
ownerId: '536e564f316c83104c000021',
isUnsubscribedFromEmails: true,
});

If you still have problems making this call after migrating, please reach out to us through the Messenger, and we can look into this further for you 🔎

View original
Did this topic help you find an answer to your question?

2 replies

Oseas
Employee
Forum|alt.badge.img+4
  • Employee
  • 103 replies
  • Answer
  • February 3, 2023

Hey @user1622​ ! Oséas here from the Customer Support Specialist team 🕵️

 

Here's our migration guide. In the latest version, you should still be able to create a user by calling client.contacts.createUser. Here's an example:

const user = await client.contacts.createUser({
externalId: '536e564f316c83104c000020',
phone: '+48370044567',
name: 'Niko Bellic',
avatar: 'https://nico-from-gta-iv.com/lets_go_bowling.jpg#39;,
signedUpAt: 1638203719,
lastSeenAt: 1638203720,
ownerId: '536e564f316c83104c000021',
isUnsubscribedFromEmails: true,
});

If you still have problems making this call after migrating, please reach out to us through the Messenger, and we can look into this further for you 🔎


  • Author
  • New Participant
  • 1 reply
  • February 6, 2023

Hej @oseas​ ,

 

thank you for your answer. We have called client.contacs.createUser with:

const user = await client.contacts.createUser({
role: 'User',
phone: '+48370044567',
email: 'nico.bellic@gmail.com',
name: 'Niko Bellic',
signedUpAt: 1638203719,
custom_attributes: {}
});

But this did not work. Might it be possible, that the ownerId was missing?

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings