fastify-xhubspot
engagement.getCalls
Retrieve call engagements associated with a HubSpot contact.
engagement.getCalls
Returns full property objects for all call engagements associated with a given HubSpot contact.
Signature
fastify.engagement.getCalls(
contactId: string,
limit?: number
): Promise<Array<{ id: string; properties: Record<string, string> }>>
Params
| Name | Type | Required | Description |
|---|---|---|---|
contactId | string | Yes | HubSpot contact ID. |
limit | number | No | Maximum number of results to return. Defaults to the HubSpot API default (100). |
Returns
Array of { id, properties } for each matching call engagement. Relevant properties keys include hs_call_body.
Throws
[xHubspot] engagement.getCalls requires a contactId- Re-throws HubSpot API errors on network failure after logging via
fastify.log.error.
Examples
Basic
const calls = await fastify.engagement.getCalls("12345");
Realistic
const calls = await fastify.engagement.getCalls("12345", 5);
for (const call of calls) {
console.log(call.properties.hs_call_body);
}
See also
- engagement.getEngagements — summarise all engagement types for a contact
- engagement.getNotes — list notes for a contact
- engagement.getTasks — list tasks for a contact
- engagement.getEmails — list emails for a contact
- engagement.createCall — log a call engagement
AI Context
package: "@xenterprises/fastify-xhubspot"
method: fastify.engagement.getCalls(contactId, limit?)
use-when: List call engagements for a given HubSpot contact
returns: Array<{ id, properties }>
