Hello!
Im trying to set the correct endpoint for my post and have tried a lot of different things, looking for documentation but there is nothing related with this more than this : Accounts Dashboard | HubSpot
In that link, we are supposed to make a post like the one im trying using the patch method to update any property from my custom object.
Its not working as its documented but by other hand i could solve my problem to the GET route within this forum by doing the following:
app.get(‘/’, async (req, res) => {
const customObjects = ‘https://api.hubspot.com/crm/v3/objects/2-14963659?portalId=12345678&properties=name&properties=description&properties=price’.
Any thoughts on what to do on my POST?
Thanks!
This is what i have thats not working…:
app.post(‘/update-cobj’, async (req, res) => {
const customObject = {
properties: {
name: req.body.name,
description: req.body.description,
price: req.body.price
}
};
const createOrUpdateCustomObjectUrl = ‘https://api.hubspot.com/crm/v3/objects/2-14963659’;
const headers = {
Authorization: `Bearer ${PRIVATE_APP_ACCESS}`,
‘Content-Type’: ‘application/json’
};
try {
await axios.patch(createOrUpdateCustomObjectUrl, customObject, { headers });
res.redirect(‘/’);
} catch (error) {
console.error(error);
res.redirect(‘/’);
}
});