Make sure you are providing a valid ISO8601 formatted timestamp value for the {{ timestamp }} placeholder. The timestamp should be in the format YYYY-MM-DDTHH:mm:ssZ, where YYYY represents the year, MM represents the month, DD represents the day, HH represents the hour, mm represents the minute, ss represents the second, and Z represents the timezone offset.
you can provide the timestamp as a string in the format '2023-05-19T12:00:00Z'.
Here's an updated code snippet for the HubSpot Events API call using the SDK
const eventType = 'pe23232_xyz';
const contactId = event.object.objectId;
const timestamp = '2023-05-19T12:00:00Z'; // Replace this with a valid ISO8601 timestamp
const response = await hubspotClient.events.eventsApi.getPage(
null,
null,
'contact',
contactId,
eventType,
null,
null,
1,
['-occurredAt'],
timestamp
);
const events = response.results; // Assuming the response object has a `results` property containing the events
console.log(events);
Make sure to replace '2023-05-19T12:00:00Z' with the actual valid timestamp value in your code.