APIs & Integrations

etienne1
Member

Get engagements for a company deprecated endpoint

SOLVE

Hello,

 

I'm trying to find a simple solution to get the list (batch) of engagements (CALL, EMAIL...) for a given company of my Hubspot account. I want to get all information of engagements (content of the email, the contacts ids associated, date of creation...).
This endpoint  perfectly fits my needs but Hubspot marks it as deprecated. We are redirected through the association endpoint but I didn't manage to get the same result as with the deprecated endpoint (1 http call to get all activities with their data scope to 1 company).

 

Indeed, I tried something like this:
https://api.hubapi.com/crm-associations/v1/associations/<company_id>/HUBSPOT_DEFINED/7

But I just get the list of engagements ids and I would need to loop on each of one to get all data of each engagement (performing N separate http call for N engagements).

Do I have a way to reproduce easely the depreacted endpoint behavior?


Stay safe

 

etienne

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Get engagements for a company deprecated endpoint

SOLVE

Hey @etienne1,

 

While you can continue using the Get Associated Engagements, I'd suggest two things here:

1. Keep a look out for  an X-HubSpot-API-Deprecated header in the response. If you detect this header in a response, please check this documentation to determine when it'll get sunset: Deprecated APIs.

 

2. Start using the CRM Associations API.

View solution in original post

0 Upvotes
7 Replies 7
Polou
Member

Get engagements for a company deprecated endpoint

SOLVE

Hello @WendyGoh 
i'd love to get the reply also. Indeed like @avlambertucci said, if an object has lots of engagements, we will need to make x api calls to get content of each engagements or even their type...

Thank you !

0 Upvotes
avlambertucci
Participant

Get engagements for a company deprecated endpoint

SOLVE

Hi @WendyGoh thanks for replying all these questions but can you please clarify @etienne1 last question about iterating through a list of engagements ID? because Its also exact pain point, eg: if a contact has 400 engagements we still would have to iterate through its ID's and only then, gather the data separately consuming several GET requests? instead of using the deprecated endpoint when used to return the 'explicid' data and not only IDS.

Thanks!

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Get engagements for a company deprecated endpoint

SOLVE

Hey @etienne1,

 

Connor addressed a similar query, check this thread out: HubSpot Community - New way to get detailed list of engagements per contact.

 

Currently, there isn't an endpoint that behavior like the deprecated endpoint. That said, thank you for sharing your use case and we will aggregate the feedback here and bring it to the product team. Appreciate it.

0 Upvotes
etienne1
Member

Get engagements for a company deprecated endpoint

SOLVE

Hey @WendyGoh ,

I thank you for your reply, I'll check the link you provided.
In the meantime, is it safe to use this deprecated endpoint in the midterm?

Best regards,

etienne

0 Upvotes
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Get engagements for a company deprecated endpoint

SOLVE

Hey @etienne1,

 

While you can continue using the Get Associated Engagements, I'd suggest two things here:

1. Keep a look out for  an X-HubSpot-API-Deprecated header in the response. If you detect this header in a response, please check this documentation to determine when it'll get sunset: Deprecated APIs.

 

2. Start using the CRM Associations API.

0 Upvotes
etienne1
Member

Get engagements for a company deprecated endpoint

SOLVE

Hello @WendyGoh ,

1.I just curled the Get Associated Engagements endpoint and I don't see the `X-HubSpot-API-Deprecated` header for the moment. I will add a watcher though to be warned the day it appears.

2. I'd like to use this API but if I understood well I would use this endpoint: `https://api.hubapi.com/crm-associations/v1/associations/<company_id>/HUBSPOT_DEFINED/7` which only returns the engagements ids of a company, and I would need to loop on each id of the response to get content of each engagement. From 1 HTTP call (Get Associated Engagements API) I go to N+1 HTTP calls (1 for association and N for number of engagements) which is less efficient. Maybe I miss something ?

Best regards,

etienne

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Get engagements for a company deprecated endpoint

SOLVE

Hey @etienne1,

 

Spot on. The Get associations for a CRM object will only return back the objectID. If you'd like to gather more details of each object, you'd need to use the respective object endpoint (i.e. CRM API | Contacts) to retrieve the object with properties.  

0 Upvotes