Answered

Create a conversation from a new contact outside of Intercom

  • 24 September 2020
  • 6 replies
  • 71 views

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

icon

Best answer by Roy 24 September 2020, 18:43

View original

6 replies

Userlevel 1

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?

Userlevel 1
Badge

Hello @tony c​ ,

 

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

contactid

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

\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

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

Userlevel 1
Badge

@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.

 

 

Reply