Add Data to Custom Objects by NodeJS Hubspot Client

Hi all,

I’m trying to add Data to a custom object by the Hubspot NodeJS API Client.

But i don’t have an option to add data to a custom object.

Is this posible via the provided hubspot connector?

(GitHub - HubSpot/hubspot-api-nodejs: HubSpot API NodeJS Client Libraries for V3 version of the API · GitHub)

Thank you,

Ronald

Hey @RMones

Welcome to the Community!

Are you still working in this issue?

I did notice that there was a new release 3 days ago. Wonder if what you need was included

Hi,

Thx @dennisedson !
I see that its updated with objects..
I’ll give it a try!

Thank you! :slightly_smiling_face:

@dennisedson that did the trick..
Thank you!

Thanks for confirming!

For future posterity on this thread:
When using the HubSpot nodejs API client, if you want to access custom object data, the notation is like this:

hubspotClient.crm.objects.basicApi.getById('object-name',objectId,['propertyOne,'propertyTwo'])

Note that you access methods on the ‘crm.objects’ package, and then specify the custom object to access by passing the object name as a parameter argument.
Here’s a bigger code sample, in which the code is accessing a custom object with the ‘fully qualified object name’ of p203693_product_incident’

hubspotClient.crm.objects.basicApi.getById('p203693_product_incident',event.object.objectId, ["product_name", "product_sku"])
.then(results => {
console.log(results.body)
let product_name = results.body.properties.product_name;
let product_sku = results.body.properties.product_sku;

callback({
outputFields: {
productSku: product_sku,
productName: product_name
}
});
})
.catch(err => {
console.error(err);
});
}