Skip to main content
Answered

Create a conversation from a new contact outside of Intercom

  • September 24, 2020
  • 6 replies
  • 93 views

  • New Participant
  • 3 replies

Hi! I'm trying to create a conversation on behalf of a newly created contact via a POST Request to `/conversations`, but continue to run into a 404 "user not found" error.

I can retrieve the contact info from the `/contacts/` endpoint, so was expecting to be able to use the "id" or "external_id" to create a conversation for that same user.

Any recommendations would be appreciated

Best answer by Roy

Hello @tony c​ ,

 

Make sure that Contact ID is correct, this is a contact ID:

contactid

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

6 replies

Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • September 24, 2020

Hey @tony c​, could you share a screenshot of what's returned from the call to the /contacts/ endpoint (taking care, of course, to blur out the customer's email address and any other identifiable information)?

 

Also, can you share the exact call you're making to the /conversations endpoint to create a conversation for that same user?


Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • Answer
  • September 24, 2020

Hello @tony c​ ,

 

Make sure that Contact ID is correct, this is a contact ID:

contactid


  • Author
  • New Participant
  • 3 replies
  • September 25, 2020

Hi Eric, thanks for taking a look. For some context, we want to send a pre-defined message on behalf of a user once the Messenger window launches, and we’re using Javascript.Attached is a screenshot of the response from the /contacts/ endpoint.Here is the call to the /conversations endpoint (currently testing using Postman):

Method: POST

Request URL: https://api.intercom.io/conversations/p>

 

Headers:

Authorization: Bearer <access token removed>

Accept: application/json

Content-Type: application/json

 

Request Body:

{

 "from": {

  "type": "user",

  "id": "5f6debfa12dc47ba151753fe"

 },

 "body": "Hi, can you help me with my order?"

}

Screen Shot 2020-09-25 at 9.10.57 AM


  • Author
  • New Participant
  • 3 replies
  • September 25, 2020

\Hi Eric and Roy, thanks for taking a look. For some context, we want to send a pre-defined message on behalf of a user once the Messenger window launches, and we’re using Javascript. Attached is a screenshot of the response from the /contacts/ endpoint.Here is the call to the /conversations endpoint (currently testing using Postman):

Method: POST

Request URL: https://api.intercom.io/conversations/p>

 

Headers:

Authorization: Bearer <access token removed>

Accept: application/json

Content-Type: application/json

 

Request Body:

{

 "from": {

  "type": "user",

  "id": "5f6debfa12dc47ba151753fe"

 },

 "body": "Hi, can you help me with my order?"

}

Screen Shot 2020-09-25 at 9.10.57 AM


  • Author
  • New Participant
  • 3 replies
  • September 25, 2020

Hi Eric, thanks for taking a look. For some context, we want to send a pre-defined message on behalf of a user once the Messenger window launches, and we’re using Javascript.Attached is a screenshot of the response from the /contacts/ endpoint.Here is the call to the /conversations endpoint (currently testing using Postman):

Method: POST

Request URL: https://api.intercom.io/conversations/p>

 

Headers:

Authorization: Bearer <access token removed>

Accept: application/json

Content-Type: application/json

 

Request Body:

{

 "from": {

  "type": "user",

  "id": "5f6debfa12dc47ba151753fe"

 },

 "body": "Hi, can you help me with my order?"

}

Screen Shot 2020-09-25 at 9.10.57 AM


Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • September 26, 2020

@tony c​ , You are misunderstanding something, This response coming from: "https://api.intercom.io/contacts/idquot; when you are trying to Retrieve a contact.

 

Are you sure that you are sending request to "https://api.intercom.io/conversationsquot;?

 

I just now tested and it's working.

 

 


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