I have been Trying to Fetch the Attachments(file) associated to the CRM object(contact). i was able to fetch the attachment id only, need to make api call to get the name and other details.
is there any api like “/api/crm-record-attachments/v1/attachments/{objectTypeId}/{objectId}/batch” it works is UI, can’t find anything close to it in API.
any way to get attachment’s(file)id and name, size in a single api ?
You can use the Files API to get data about the file if you have an ID.
However, one thing I have encountered with file uploads to an object record is that they are often set to not be public which (for me) was an issue if I tried to use it anywhere as links to the file required a hubspot login. I believe I ended up having to to use the API and update the the file to be public so that I could link to it.
Hi @MichaelMa , Thanks for the Reply. I believe there is a gap understanding. as you suggested works for single File id. I am taking about List of File ID(From Attachments). I mean attachment is associated to a CRM objects(Like Contact, Deals, Company).
Hey @ramkumar1021, thanks for the additional information!
To add to what @MichaelMa shared (thank you!), currently, there isn’t a single API endpoint that provides attachment details (like name and size) directly from a CRM object association.
However, you can easily get this information by following two simple steps:
First, retrieve the attachment IDs from your CRM contact, which you’re already doing!
Then, for each ID, use the GET /files/v3/files/{fileId} endpoint to fetch file details like name, size, extension, type, URL, and more.
At the moment, there isn’t a public batch endpoint for the Files API, so you’ll want to make individual calls for each file ID.
If you’re looking to access private files, the GET /files/v3/files/{fileId}/signed-url endpoint will give you a temporary access URL, along with the name and size.
Here is the documentation for it:
I hope it helps!
Have a wonderful weekend!
Bérangère
This post was created with the assistance of AI tools