Hey there,
I just noticed that the hubspotClient.crm.deals.searchApi.doSearch is expecting the after property to be a number. Although, the after property returned by the API itself is a string.
You can check out the API here: Accounts Dashboard | HubSpot
Is this correct? Am I missing something?
Hello @vinyoliver
You are correct that the after property returned by the HubSpot CRM Deals Search API is a string, while the after parameter expected by the doSearch method of the Node.js client library for HubSpot is a number.
This is due to a discrepancy between the API documentation and the Node.js client library implementation. The API documentation states that the after property is a string, while the Node.js client library expects it to be a number.
To work around this, you can convert the after property value from a string to a number before passing it to the doSearch method. Here’s an example
const hubspotClient = new hubspot.Client({ accessToken: 'YOUR_ACCESS_TOKEN' });
const afterStr = '12345'; // replace with the value of the "after" property returned by the API
const afterNum = Number(afterStr); // convert the "after" property value to a number
const response = await hubspotClient.crm.deals.searchApi.doSearch({ after: afterNum });
By converting the after property value to a number before passing it to the doSearch method, you should be able to avoid the type mismatch error.