Tickets & Conversations

BB33
Member

List Ticket's Note

SOLVE

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 ?

0 Upvotes
1 Accepted solution
JBeatty
Solution
Guide | Diamond Partner
Guide | Diamond Partner

List Ticket's Note

SOLVE

There are 2 other ways, but they each have their own drawbacks.

 

The first is to use the "GET /engagements/v1/engagements/associated/:objectType/:objectId/paged" Endpoint. This endpoint will go grab associated engagements, and return the actual engagements, but this endpoint is currently deprecated, so use it with caution.

 

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.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk

View solution in original post

7 Replies 7
BB33
Member

List Ticket's Note

SOLVE

There is another problem with this approach.

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!

0 Upvotes
JBeatty
Solution
Guide | Diamond Partner
Guide | Diamond Partner

List Ticket's Note

SOLVE

There are 2 other ways, but they each have their own drawbacks.

 

The first is to use the "GET /engagements/v1/engagements/associated/:objectType/:objectId/paged" Endpoint. This endpoint will go grab associated engagements, and return the actual engagements, but this endpoint is currently deprecated, so use it with caution.

 

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.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk

BedadaDugo
Member

List Ticket's Note

SOLVE

I haven't question

0 Upvotes
BB33
Member

List Ticket's Note

SOLVE

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 !

0 Upvotes
JBeatty
Guide | Diamond Partner
Guide | Diamond Partner

List Ticket's Note

SOLVE

Hi @BB33,

 

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.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk

BB33
Member

List Ticket's Note

SOLVE

Hi,
Thanks , but it is not simple way for integration

0 Upvotes
PamCotton
Community Manager
Community Manager

List Ticket's Note

SOLVE

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?

 

Thank you!

Pam

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !