HubSpot / hubspot-api-python

HubSpot API Python Client Libraries for V3 version of the API
Apache License 2.0
326 stars 104 forks source link

how to fetch all file attachments of deals #318

Open CribberSix opened 3 weeks ago

CribberSix commented 3 weeks ago

How can I fetch all file attachments of a specific deal? I can retrieve companies and contacts, but I cannot retrieve attachments.

response_raw = api_client.crm.deals.basic_api.get_by_id(
    deal_id="100000000001",
    properties=["pipeline"],
    associations=["companies", "contacts", "attachments"]  # "attachments" does not work - throws an error.
)

The error: HTTP response body: {"status":"error","message":"Unable to infer object type from: attachments","correlationId":"0859d068-6dc3-40ff-9892-90a0ad09fb8c"}

For instance, I see in the Website UI that various files have been attached to a deal, but I have been unable to retrieve this list of files / their meta data via the python package (or via the API).

My goal is to retrieve the meta data of all attachments that exist in combination with their deal-id to which they are attached.