[Hubspot API] How do you use IN filter operator?

Hi @CSwart ,

I checked the Deals docs, and I think you can retrieve the deals with two endpoints.

Batch read (inputs= should get your array of ID’s):

import hubspot
from pprint import pprint
from hubspot.crm.deals import BatchReadInputSimplePublicObjectId, ApiException

client = hubspot.Client.create(api_key="YOUR_HUBSPOT_API_KEY")

batch_read_input_simple_public_object_id = BatchReadInputSimplePublicObjectId(properties="dealname", inputs=[{"id":"3651752129"},{"id":"3741754830"}])
try:
 api_response = client.crm.deals.batch_api.read(archived=False, batch_read_input_simple_public_object_id=batch_read_input_simple_public_object_id)
 pprint(api_response)
except ApiException as e:
 print("Exception when calling batch_api->read: %s\n" % e)

Search:

import hubspot
from pprint import pprint
from hubspot.crm.deals import PublicObjectSearchRequest, ApiException

client = hubspot.Client.create(api_key="YOUR_HUBSPOT_API_KEY")

public_object_search_request = PublicObjectSearchRequest(filter_groups={"filters":[{"value":"3741754830","propertyName":"hs_object_id","operator":"EQ"},{"value":"3651752129","propertyName":"hs_object_id","operator":"EQ"}]}, sorts="dealname", query="string", properties="dealname", limit=10, after=0)
try:
 api_response = client.crm.deals.search_api.do_search(public_object_search_request=public_object_search_request)
 pprint(api_response)
except ApiException as e:
 print("Exception when calling search_api->do_search: %s\n" % e)

OR:

import hubspot
from pprint import pprint
from hubspot.crm.deals import PublicObjectSearchRequest, ApiException

client = hubspot.Client.create(api_key="YOUR_HUBSPOT_API_KEY")

public_object_search_request = PublicObjectSearchRequest(filter_groups={"filters":[{"value":"[\"3651752129\", \"3741754830\"]","propertyName":"hs_object_id","operator":"IN"}]}, sorts="dealname", query="string", properties="dealname", limit=10, after=0)
try:
 api_response = client.crm.deals.search_api.do_search(public_object_search_request=public_object_search_request)
 pprint(api_response)
except ApiException as e:
 print("Exception when calling search_api->do_search: %s\n" % e)