Skip to main content

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?

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


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": t

{

"operator": "OR",

"value": t

{

"field": "created_at",

"operator": ">",

"value": 1560436650

},

{

"field": "signed_up_at",

"operator": ">",

"value": 1560436784

}

]

},

{

"operator": "OR",

"value": t

{

"field": "custom_attributes.salseforce_status",

"operator": "~",

"value": "Open"

},

{

"field": "custom_attributes.salesforce_object_type",

"operator": "=",

"value": "Lead"

}

]

}

]

}

}'


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.


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


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


Reply