i am integrating my back-end to hubspot ticket system.
i send my user's reply as engagement (NOTE) and associate that with ticket. i want to get new admin's reply (responded to ticket). so i think i should get all engagement's , associated to ticket. <get-crm-association>and find new engagement ids , that are not exist in my database. (as new admin's reply) then get that engagement's information (body-preview , sourceId ,...) <get-engagement>
and if engagement has attachment, download that.<get-signed-url> and download. finally i should show admin's reply (engagement's note + attachment) to my client.
so for get new admin's reply (NOTE) i should call api : 1.<get-crm-association>
2.<get-engagement>
3.<get-signed-url>
4.download attachment from signed-url am i on the right track? is there any api that do all of these stuff, in one api call ?
The other possibility would be to use the "GET /engagements/v1/engagements/recent/modified" Endpoint. This endpoint will return all engagements in the entire portal, within a specified timeframe, sorted by time updated/created, and display their information. You could constantly call this endpoint every 5-10 minutes and store all values in your database, this is also a viable solution, though I have not directly used this before in a production enviornment, but it should work properly.
✔️ Was I able to help answer your question? Help the community by marking it as a solution.
when you get list of engagems, it is not sorted by date ! for example if you have some <NOTE> (messages) like this :
id : 2 , msg : Hi.<client> id : 3 , msg: By.<admin>
id : 1 , msg : ok, by.<client>
hubspot assigned this id's.**
when you call hubspot API to get engagement list, result : [1,2,3]
also think about , i can not get all of engagement list for a client because of rate-limit , i should get engagement info for client every about 10 minute. and my user will confused about messages !!!!
finally , when i got every engagement, i sort them by their created_at timestamp, and every thing will be ok.
also i will call hubspot , several times, and it will so complicate to handle rate limit and sync all ticket messages.(get engagement list in about 4 steps! , add reply for ticket in about 5 steps!! and ......) so i am in the right way yes !? there is no another approach!
The other possibility would be to use the "GET /engagements/v1/engagements/recent/modified" Endpoint. This endpoint will return all engagements in the entire portal, within a specified timeframe, sorted by time updated/created, and display their information. You could constantly call this endpoint every 5-10 minutes and store all values in your database, this is also a viable solution, though I have not directly used this before in a production enviornment, but it should work properly.
✔️ Was I able to help answer your question? Help the community by marking it as a solution.
it is not possible to call api in every 5-10 minute , in production env ! think about i have 1M user and i want to integrate with hubspot. i dont know why hubspot do not provide some simple api!! thanks !
I actually have done something very similar with engagements on tickets. This was the same approach I took. Untill the engagements API gets a V3 update this is the best solution. Hopefully in the future there will be a search API for engagements, but for now this logic is sound, and very similar to my solution.
✔️ Was I able to help answer your question? Help the community by marking it as a solution.
Hello @BB33, thank you for providing this information! I will be adding some top experts to share their opinion @JBeatty, @DanielSanchez any recommendations to @BB33?