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