APIs & Integrations

andy_gh
Participant

Getting Latest Notes In Tickets

Hello!

I'm trying to get the latest notes in a specific ticket and send the latest notes to Jira. I have found various posts to make this happen but these solutions are not ideal for accounts with millions of contacts, companies, tickets, etc.

Option 1
Hubspot apps have an option to create custom webhooks but these webhooks don't have an option for tickets. The only options are for contact, company or deals but if you select contact there is no option for notes on a contact.


Option 2
https://api.hubapi.com/engagements/v1/engagements/recent/modified
This endpoint will give me all of the latest engagement in our Hubspot instance. This will give me the latest notes of all hubspot objects but with the number of objects we have the desired note will not be provided by the time the workflow runs. This is because this endpoint is limited to 250 results and bottom of the results are no older than 1-2 minutes.


Option 3
https://api.hubapi.com/crm/v3/objects/notes/
This endpoint will limit the engagement results to only notes in our Hubspot instance but the returned JSON does not include the note body.

 

Below is an example:

{ "id": "1234567899", "properties": { "hs_createdate": "2017-10-17T21:34:53.034Z", "hs_lastmodifieddate": "2019-08-21T22:39:35.066Z", "hs_object_id": "1234567899" }, "createdAt": "2017-10-17T21:34:53.034Z", "updatedAt": "2019-08-21T22:39:35.066Z", "archived": false }

With only the above response its hard to know if the note is the note I have left on my test ticket. This endpoint will also provide an option to search the notes but this is only helpful if you know the content of the body. In my case, the only time I will know the content is when I'm testing.

Has anyone ran into this scenario and solved it successfully?

1 Reply 1
dennisedson
HubSpot Product Team
HubSpot Product Team

Getting Latest Notes In Tickets

@andy_gh 

Hopefully, we will have some webhooks for engagements sooner than later 🤞

Option 3 may work.  If you add hs_note_body as an additional query param on the API call, you will get the note body returned.

https://api.hubapi.com/crm/v3/objects/notes?archived=false&hapikey={{hapikey}}&properties=hs_note_body

You can see all of the available properties the notes engagement has by polling the properties endpoint. 

Call would look like this

https://api.hubapi.com/crm/v3/properties/notes?archived=false&hapikey={{hapikey}}