CMS Development

MUlHuq
Member | Platinum Partner
Member | Platinum Partner

How to fetch contact activities?

SOLVE

I am looking forward to fetching the contact activity in a module.
I can pull associated custom CRM object properties in the frontend.
Is there a way to retrieve the requested contact activity in the frontend?

0 Upvotes
1 Accepted solution
ArisudanTiwari
Solution
Guide | Gold Partner
Guide | Gold Partner

How to fetch contact activities?

SOLVE

Hi @MUlHuq ,
You can’t fetch detailed contact activities (like emails, calls, meetings, etc.) directly in the frontend using HubL or CMS modules. HubL doesn't support querying activity logs due to security and privacy restrictions.


What You Can Do Instead:

1. Use HubSpot’s CRM APIs (backend only)
If you need detailed activity like calls or emails, you’ll want to use the Engagements API or CRM Associations API.

  • Example: You can get a list of engagement IDs tied to a contact, then pull the activity details using those IDs.
  • These calls require authentication (OAuth or Private App token), so they should only be made from a secure backend, not directly in the frontend.

2. Use a middleware or custom app
You can set up a small backend service to fetch activity data securely from the API and send only the needed info (like as an activity summary) to your frontend or HubSpot module.


3. Manual workaround using HubDB or custom properties

If you only need to show basic activity info (like "last contacted" or a summary), you could:

  • Store that info in a custom contact property or a HubDB table via a workflow or integration
  • Then render it using HubL in your module or template

This won’t be real-time, but it can work well for static display needs.

Here are a few useful links to get started:
Get call activity for a contact - https://community.hubspot.com/t5/APIs-Integrations/Get-quot-Call-quot-Activity-from-a-Specific-Conta...
Engagements API Docs - https://developers.hubspot.com/docs/reference/api/crm/engagements/engagement-details

If my reply answered your question, please mark it as a solution to make it easier for others to find.


Cheers!

Arisudan Tiwari
HubSpot Advisor



Grazitti

View solution in original post

0 Upvotes
1 Reply 1
ArisudanTiwari
Solution
Guide | Gold Partner
Guide | Gold Partner

How to fetch contact activities?

SOLVE

Hi @MUlHuq ,
You can’t fetch detailed contact activities (like emails, calls, meetings, etc.) directly in the frontend using HubL or CMS modules. HubL doesn't support querying activity logs due to security and privacy restrictions.


What You Can Do Instead:

1. Use HubSpot’s CRM APIs (backend only)
If you need detailed activity like calls or emails, you’ll want to use the Engagements API or CRM Associations API.

  • Example: You can get a list of engagement IDs tied to a contact, then pull the activity details using those IDs.
  • These calls require authentication (OAuth or Private App token), so they should only be made from a secure backend, not directly in the frontend.

2. Use a middleware or custom app
You can set up a small backend service to fetch activity data securely from the API and send only the needed info (like as an activity summary) to your frontend or HubSpot module.


3. Manual workaround using HubDB or custom properties

If you only need to show basic activity info (like "last contacted" or a summary), you could:

  • Store that info in a custom contact property or a HubDB table via a workflow or integration
  • Then render it using HubL in your module or template

This won’t be real-time, but it can work well for static display needs.

Here are a few useful links to get started:
Get call activity for a contact - https://community.hubspot.com/t5/APIs-Integrations/Get-quot-Call-quot-Activity-from-a-Specific-Conta...
Engagements API Docs - https://developers.hubspot.com/docs/reference/api/crm/engagements/engagement-details

If my reply answered your question, please mark it as a solution to make it easier for others to find.


Cheers!

Arisudan Tiwari
HubSpot Advisor



Grazitti

0 Upvotes