Answered

Getting: "message": "User Not Found" when trying to merge two contacts that exists in the workspace.


Hello,

 

I am trying to merge contacts leads into users as follow:

 

curl --location --request POST 'https://api.intercom.io/contacts/merge#39; \

--header 'Authorization: Bearer toto=' \

--header 'Content-Type: application/json' \

--header 'Accept: application/json' \

--data-raw '{

  "from": "623f6320f06ce936269f7bd9",

  "to": "6189c5687f416a8308a57a23"

}'

When I try and query for them individually like this:

 

curl --location --request GET 'https://api.intercom.io/contacts/623f6320f06ce936269f7bd9#39; \

--header 'Authorization: Bearer toto=' \

--header 'Content-Type: application/json' \

--header 'Accept: application/json'

 

The API returns the contact (lead or user) that I want to merge.

Also, same result when going through the platform:

 

https://app.intercom.com/a/apps/glsleifc/users/623f6320f06ce936269f7bd9/all-conversations/p>

 

I get the proper profile with associated conversation.

 

Yet, when I want to merge those contacts, every time the API is returning the exact same error:

 

"errors": [

{

"code": "not_found",

"message": "User Not Found"

}

]

 

Example of request IDs: 0005jfdjun8hdl9s8i7g | 0005clbhq0fgr6eviumg

 

We only have one workspace so I'm almost sure it's not the root cause of the problem.

Can someone help me figure out why the mergers are not happening?

 

Thanks a lot in advance!

icon

Best answer by Evan P 27 June 2022, 13:54

View original

2 replies

Hey @product t14​ , 👋 thanks for reaching out! I'm one of the Support Engineers here at Intercom!

 

I had a look at the request you are making & I found one error associated with the body of your request. I see you are using "to" when referring to the user you want to merge into. However you have to "into" here. If you modify this you should solve your issue. 🙌

 

curl --location --request POST 'https://api.intercom.io/contacts/merge#39; \

--header 'Authorization: Bearer toto=' \

--header 'Content-Type: application/json' \

--header 'Accept: application/json' \

--data-raw '{

  "from": "623f6320f06ce936269f7bd9",

  "into": "6189c5687f416a8308a57a23"

}'

 

I hope this helps clarify. 😁

 

Hey!

Indeed it was the issue, as simple as that... 😣

Thanks a lot for your answer!

Reply