We use the NPM library @hubspot/api-client to create timeline events on CRM objects, such as Contacts.
Our event templates include tokens which have types other than string, for instance 'numeric' and 'Date'. But the Hubspot api clients does not appear to have a way to send event tokens in formats other than string. The token data is included in the payload as
'tokens': {
[key: string]: string;
};
Does anyone know if there is a way to send tokens with other types?
I was able to get this working. It seems that only the Hubspot definition of the type needs to be correct. If I pass a number as a token, then it appears to be coerced into a string, but then converted back to a number by Hubspot. A Date type is just a Unix epoch as a number.