Skip to main content
Answered

Error response when invoking contact search API


When I invoke the contact search API, I get the following error response.

 

{

"type": "error.list",

"request_id": "0009s379b118psj1f100",

"errors": [

{

"code": "invalid_document",

"message": "either_email_or_user_id_present validation failed"

}

]

}

 

Does anyone know what has gone wrong here?

Best answer by Eric Fitz

Looks like you're sending that POST to https://api.intercom.io/contacts which will try and create a contact.

 

You can send the POST to https://api.intercom.io/contacts/searchto hit the contact search endpoint.

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

5 replies

Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • March 19, 2021

Hey @rushmin​, could you provide me with an example of an API call that you made which returned this error, please?


  • Author
  • New Participant
  • 2 replies
  • March 19, 2021

Hi @eric f11​ thank you for the response. I tried various combinations. Below is one of them.

 

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

--header 'Accept: application/json' \

--header 'Authorization: Bearer xxxxxxxxxxx' \

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

--data-raw '{

"query": {

"operator": "AND",

"value": [

{

"operator": "OR",

"value": [

{

"field": "created_at",

"operator": ">",

"value": 1560436650

},

{

"field": "signed_up_at",

"operator": ">",

"value": 1560436784

}

]

},

{

"operator": "OR",

"value": [

{

"field": "custom_attributes.salseforce_status",

"operator": "~",

"value": "Open"

},

{

"field": "custom_attributes.salesforce_object_type",

"operator": "=",

"value": "Lead"

}

]

}

]

}

}'


Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • Answer
  • March 23, 2021

Looks like you're sending that POST to https://api.intercom.io/contacts which will try and create a contact.

 

You can send the POST to https://api.intercom.io/contacts/searchto hit the contact search endpoint.


  • Author
  • New Participant
  • 2 replies
  • March 24, 2021

Thanks a lot, Eric. That was the issue. I have missed the endpoint in the documentation. Sorry for the trouble.


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

No trouble at all, @rushmin​! I'm glad we could get this resolved for you 🙌


Reply


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