fastify-xhubspot
engagement.getNotes
Retrieve note engagements associated with a HubSpot contact.
engagement.getNotes
Returns full property objects for all note engagements associated with a given HubSpot contact.
Signature
fastify.engagement.getNotes(
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 note engagement. Relevant properties keys include hs_note_body.
Throws
[xHubspot] engagement.getNotes requires a contactId- Re-throws HubSpot API errors on network failure after logging via
fastify.log.error.
Examples
Basic
const notes = await fastify.engagement.getNotes("12345");
Realistic
fastify.get("/contacts/:id/notes", async (request, reply) => {
const notes = await fastify.engagement.getNotes(request.params.id, 10);
return reply.send({ notes });
});
See also
- engagement.getEngagements — summarise all engagement types for a contact
- engagement.getTasks — list tasks for a contact
- engagement.getCalls — list calls for a contact
- engagement.getEmails — list emails for a contact
- engagement.createNote — log a note against a contact
AI Context
package: "@xenterprises/fastify-xhubspot"
method: fastify.engagement.getNotes(contactId, limit?)
use-when: List note engagements for a given HubSpot contact
returns: Array<{ id, properties }>
