How to get all the note Ids for a given file Id using API ?
SOLVE
I want to know the notes which are using a particular file, and thus want the list of all noteIds associated with a file (i.e. noteIds for all the note which are having file as an attachment) using Hubspot API.
Currently API available is to get the attachment id for a particular note.
Jul 12, 20246:07 AM - edited Jul 12, 20246:11 AM
Participant
How to get all the note Ids for a given file Id using API ?
SOLVE
Hey I found the solution,
I'm using the Search endpoint. First of all you will need the id of the particular file you want, I got it per the file API. Now you can call the search endpoint from the notes and filter for "hs_attachement_ids" as propertyName which should equal the value of your file id.
Jul 12, 20246:07 AM - edited Jul 12, 20246:11 AM
Participant
How to get all the note Ids for a given file Id using API ?
SOLVE
Hey I found the solution,
I'm using the Search endpoint. First of all you will need the id of the particular file you want, I got it per the file API. Now you can call the search endpoint from the notes and filter for "hs_attachement_ids" as propertyName which should equal the value of your file id.
How to get all the note Ids for a given file Id using API ?
SOLVE
Hey @sgupta046, thank you for posting in our Community!
Use the existing API endpoint to get the attachment IDs associated with the file ID you're interested in. This is the current API you mentioned. Once you have the attachment IDs, you can then use another API endpoint to retrieve the note IDs associated with those attachment IDs.
How to get all the note Ids for a given file Id using API ?
SOLVE
Hey @sgupta046 To retrieve all note IDs associated with a specific attachment ID in HubSpot using the API, you would typically utilize the HubSpot CRM Associations API. This API allows you to fetch associations between different types of objects, such as contacts, companies, deals, and attachments. Specifically, you'll want to focus on the GET /crm-associations/v1/associations endpoint.
How to get all the note Ids for a given file Id using API ?
SOLVE
Hey @PamCotton, I have read the entire documentation, but there is no API in associations for getting all noteIds associated with attachment. This association API is for objects like deals,tickets, notes, etc. and attachment is not an object.
Also my use case is to get all the noteIds for a particular attachmentId (not the vice versa of it). The issue is to get attachment Ids, I need to make 2 API calls. First, get all the engagement ids(noteIds) for a particular deal(object). Second, for each engagementId (by iterating each one of them) and check whether that particular attachment Id is there or not (by making another API call). And this complete operation is time taking.
So I just need an API (if there is any) from which I can directly get all the noteIds for a particular attachment.