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?
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.
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.