at the bottom we could see last function for search, where we should be able to get contact by email, but for some reason we always get response Invalid input JSON on line 1
code from my screen is not my code - thats code form hubspot documentation, and I see same syntax error.
And yes, I tried to refactor code to move filter to array and json_encode them, but in this case we always get response from api like this -
[400] Client error: `POST https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=xxx` resulted in a `400 Bad Request` response: {"status":"error","message":"Invalid input JSON on line 1, column 17: Cannot deserialize instance of `java.util.HashSet` (truncated...)
This is I write here. Code in documentation is not valid, and when I try to refactor it to json I always get error.
If I throw this in Visual Studio code, I get the following error:
I checked the code, but the JSON is incorrect that is passed in "filter_groups". I am not completely sure, but I think it should be refactored to something like this: