We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Mar 14, 2022 3:59 PM - edited Mar 14, 2022 4:50 PM
Hey all,
I am currently trying to get a list of all the notes, along with their hs__note_body, or the body_preview (to pull the note message into our internal systems). I've been been looking over/sending requests to the Ticket/Notes/Engagements API's. So far I've only been able to do this by:
1) hitting https://api.hubapi.com/crm/v3/objects/tickets/{{ticketId}}?hapikey={{KEY_HERE}}&associations=engagments
to pull ticket Details and its associations to notes, example response below:
{
"id": "...",
"properties": {
....
},
"associations": {
"engagements": {
"results": [
{
"id": "engagementId1",
"type": "ticket_to_engagement"
},
{
"id": "engagementId2",
"type": "ticket_to_engagement"
},
{
"id": "engagementId3",
"type": "ticket_to_engagement"
},
{
"id": "engagementId4",
"type": "ticket_to_engagement"
}
]
}
}
}
then using the engagementIds from the above response to hit:
2)https://api.hubapi.com/engagements/v1/engagements/{{EngagmeentID}}?hapikey={{KEY_HERE}} to pull data for that 1 note (based on its engagementID) to get its bodyPreview. Example Below:
{
"engagement": {
......
"source": "CRM_UI",
"allAccessibleTeamIds": [],
"bodyPreview": "hi",
"queueMembershipIds": [],
"bodyPreviewIsTruncated": false,
"bodyPreviewHtml": "<html>\n <head></head>\n <body>\n <p>hi</p>\n </body>\n</html>"
},
"associations": {
"contactIds": [],
"companyIds": [],
"dealIds": [],
"ownerIds": [],
"workflowIds": [],
"ticketIds": [
1234
],
"contentIds": [],
"quoteIds": []
},
"attachments": [],
"metadata": {
"body": "<p>hi</p>"
}
}
I would have to do this call several times, for every unique ticketId I wanted to gather Note body information from.
I haven't seen a batch "get all notes and their details, given a ticketId" endpoint - there's got to be a better way to do the above? this is the closest thing that I've seen in the forums, but it doesn't appear to be what we're looking for
https://community.hubspot.com/t5/APIs-Integrations/Getting-Latest-Notes-In-Tickets/m-p/571049#M50703
Solved! Go to Solution.
Aug 8, 2022 1:44 PM
I recently used the /crm/v3/objects/notes/search endpoint to get a lost of notes associated with a certain custom objectId. Should be able to modify it for your use case.
// /crm/v3/objects/notes/search
{
"filterGroups": [
{
"filters": [
{
"propertyName": "hs_attachment_ids",
"operator": "EQ",
"value": "<<ticketId>>"
}
]
}
],
"properties": [
"hs_note_body"
]
}
Mar 15, 2022 4:08 AM
hi vplatform
You can directly get the notes using notes engaments API i.e. GET/crm/v3/objects/notes
refer to = https://developers.hubspot.com/docs/api/crm/notes, it already have the params hs__note_body which you want , you dont have to calll a seperate API to achieve this
Hope this helps! If we were able to answer your query, kindly help the community by marking it as a solution. Thanks and Regards.
Mar 15, 2022 9:28 AM - edited Mar 15, 2022 9:49 AM
@ChehakWadhdwa
I don't want to get a random list of all the notes possible (say we have 1,000 tickets created in our dashboard, then your above solution to just hit GET/crm/v3/objects/notes would retrieve a paginated dump of all notes that exist, regardless of a specific ticketId). I want to specifiy a ticketId in the request above, and get a list of all notes for that ticketId
Aug 8, 2022 1:44 PM
I recently used the /crm/v3/objects/notes/search endpoint to get a lost of notes associated with a certain custom objectId. Should be able to modify it for your use case.
// /crm/v3/objects/notes/search
{
"filterGroups": [
{
"filters": [
{
"propertyName": "hs_attachment_ids",
"operator": "EQ",
"value": "<<ticketId>>"
}
]
}
],
"properties": [
"hs_note_body"
]
}
Jun 10, 2022 2:12 PM
No response either? Everyone just points to the API docs. Trying to do this with contacts/deals. I want to get all notes associated with a contact_id.