Attaching files to object via the APIs

How can one attach files to objects (deals, contacts, companies etc) using the APIs. I am seeing some activity on this question in the community with no definete answers.

The Files API documentation hints at this being possible via the engagemetns API

a.png

Looking however at engagements, it appears as though there is no support for files

How can this be achieved?

Thanks

Hi, @thulani :waving_hand: I have an example here — Attach file to deal record using API.

The quick version —

  • Upload the file
  • Create a Note
  • Associate the File to the Note
  • Associate the Note to the Object

Have fun building! — Jaycee

Thanks for the quick response. I will give this a try and mark this as the solution if all goes well.

I really appreciate how quick you responded here :grinning_face_with_smiling_eyes:

Hi @Jaycee_Lewis

This solution is indeed working well and I have used it, however it seems like there is a limit for uploading files into the file manager. I have about 3000 files but I am able to upload olny 250 files.

I have noticed that if I attach an external file to the object it doesn’t go to file manager but stays attached to the object. And if I attach a file using API I have to upload to filemanager first which has a limit then if I delete thefile from the file manager it disapears from attached object as well. Is there any solution for attaching big amount of files to objects via API?

Hi Everyone,

I work for a HubSpot Diamond Partner. We have developed an app for the marketplace that helps identify objects with attached files and provides a live count of the associated attachments, continuously updated in real-time.

We are seeking beta testers who can try our app at no cost, provide valuable feedback, and assist us in enhancing the product’s overall usability.

:backhand_index_pointing_right: Join the Beta Test → Installation link :link:

:backhand_index_pointing_right: How it works document → PDF

While you’re here, don’t forget to check out our other apps in the HubSpot Marketplace for more helpful solutions!

Cheers!