We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Jul 31, 2022 6:44 PM - edited Jul 31, 2022 6:46 PM
NO result:
curl --request POST --url https://api.hubapi.com/crm/v3/objects/contacts/search \
--header 'authorization: Bearer ###### --header 'content-type: application/json' \
--data '{
"filterGroups": [
{
"filters": [
{
"operator": "IN",
"propertyName": "nav_guid",
"values": ["FD291D3E-F357-49BA-87D4-EA0E6234EB57"]
}
]
}
],
"properties": [
"nav_guid"
]
}'
{"total":0,"results":[]}
WORKS:
curl --request POST --url https://api.hubapi.com/crm/v3/objects/contacts/search \
--header 'authorization: Bearer ###### --header 'content-type: application/json' \
--data '{
"filterGroups": [
{
"filters": [
{
"operator": "EQ",
"propertyName": "nav_guid",
"value": "FD291D3E-F357-49BA-87D4-EA0E6234EB57"
}
]
}
],
"properties": [
"nav_guid"
]
}'
{"total":1,"results":[{"id":"10901","properties":{"createdate":"2022-05-19T13:17:42.678Z","hs_object_id":"10901","lastmodifieddate":"2022-05-19T13:18:37.780Z","nav_guid":"FD291D3E-F357-49BA-87D4-EA0E6234EB57"},"createdAt":"2022-05-19T13:17:42.678Z","updatedAt":"2022-05-19T13:18:37.780Z","archived":false}]}
I am a fullstack-developer and I am currently creating a sync-solution from MS-Navision to Hubspot.
I get no result when searching via IN-operator, though the same search with EQ works. What do I have to change? IN is used since I need to have at least a few contacts as a package for perfoemance reasons. Other possibilitys would be to parallelize request to the Hubspot-API up to API-limits, which would produce unnecessary load for both involved systems (Hubspot as well as emitting server). I am using the PHP-librabry (hubspot/api-client), but to remove possible coding errors on my side, I am trying if this even works via CURL (#### is removed for privacy-reasons, since this contains customer-data)
Label might be wrong, but since to my knowledge this customer has an Enterprise account with arround 500k contact-volume this seemed most appropriate when browsing the available options.
bR, Stefan
Solved! Go to Solution.
Aug 1, 2022 5:55 AM - edited Aug 1, 2022 5:57 AM
Hi @SBeranek,
First, I'm sorry that i was completely misunderstanding everything, please forget my ealier post. It' not completely correct.
Then, I tried your situation and got same problem. Finally I handle it with lower case values in request body. Try like this:
{
"operator": "IN",
"propertyName": "nav_guid",
"values": ["fd291d3e-f357-49ba-87d4-ea0e6234eb57"]
}
Aug 1, 2022 1:03 AM
Hi @SBeranek .
IN operator works when propety type is list (= array), so the type of nav_guid must be list when IN wokrs.
How about CONTAINS_TOKEN operator? Doesn't this suit what you want to do?
Aug 1, 2022 5:21 AM
@assi Thank you for this answer - which type with a not pre-defined list of options are you referring to with "list" ? I need multiple values here and have just simplified this example to one, therefore I presume "CONTAINS TOKEN" does not apply here in a useful way - please correct me if there is a way to use multiple values with "CONTAINS TOKEN".
Aug 1, 2022 5:55 AM - edited Aug 1, 2022 5:57 AM
Hi @SBeranek,
First, I'm sorry that i was completely misunderstanding everything, please forget my ealier post. It' not completely correct.
Then, I tried your situation and got same problem. Finally I handle it with lower case values in request body. Try like this:
{
"operator": "IN",
"propertyName": "nav_guid",
"values": ["fd291d3e-f357-49ba-87d4-ea0e6234eb57"]
}
Aug 1, 2022 6:01 AM
WOW! That really was the solution! Thanks alot!
Aug 1, 2022 6:05 AM
I'm glad to solve your problem ! (☝ ՞ਊ ՞)☝
HubSpot API sometimes has weird implicit rules...
Aug 9, 2022 10:54 PM
Thanks so much for this solution Assi! This was blocking me for about a week!
Its pretty cooked that this isn't noted in the Search API documentation