Closed mSigson closed 1 year ago
@mSigson - Thanks for getting in touch! We'll review this and get back to you ASAP.
Just did some quick digging.
First off, thanks again for the report, the SDK definitely should handle this better.
To your actual issue, the reason a 500 is being thrown appears to be because you're passing an AND
operator, but only one query. AND
should be used for combining queries. I assume you might be trying to do something like
const query = await client.contacts.search({
data: {
query: {
field: "email",
operator: intercom.Operators.CONTAINS,
value: '@intercom.io',
},
},
});
I've created an issue to track some changes we could make to improve the error handling here, but I think double checking your query string should solve your problem.
If not, reopen this and we can dig further.
Thank you for the fix and quick response @colmdoyle ! Silly mistake on my end 🙏
Version info
^4.0.0
v16.15.0
Expected behavior
Able to successfully search for an intercom contact via the
intercom.contacts.search
client methodActual behavior
Getting a 500 response when trying to search for a contact
Steps to reproduce
service
client
Logs