Is Not JSON serializable (Python query)

Hi I’m trying to retrieve deal information via the following Python code:

import hubspot

import requests

import json

from pprint import pprint

from hubspot.crm.deals import PublicObjectSearchRequest, ApiException

api_client = hubspot.Client.create(access_token=“***”)

public_object_search_request = PublicObjectSearchRequest(

filter_groups=[

{

“filters”: [

{

“value”: “Enquiry”,

“propertyName”: “status”,

“operator”: “EQ”

}

]

}

], properties=[“last_name”, “status”, “object_id”], limit=100

)

api_response = api_client.crm.deals.search_api.do_search(public_object_search_request=public_object_search_request)

print(json.dumps(api_response, indent=4))

When executing I’m getting the following error:

TypeError: Object of type CollectionResponseWithTotalSimplePublicObjectForwardPaging is not JSON serializable

Anyone with any advice will be most helpful

Hi, @TB86 :waving_hand: Welcome to our community! Were you able to get this resolved?

Best,

Jaycee