Trouble with the app.post route

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(‘/’);

}

});

Hi, @romerocam :waving_hand: Thanks for your question. Including your code examples is very helpful for our community and assists their understanding.

Can you confirm my understanding of your goals, please? Are you attempting something similar to an upsert? Or something similar?

If not, can you clarify things a bit for the community?

If so, you may need to update your approach by making several calls — verify the record exists, then POST or PATCH depending on the result.

Other questions:

  • Is there a specific error message being returned?
  • Have you tried using a tool like Postman to test your API request outside your application? If so, what were the results?

Thank you for providing more details. This will help the community give you more targeted advice.

Thank you! — Jaycee

Hello Jaycee!
Thanks for your answer! Im actrually trying to make the integration with hubspot certification and i havent succeeded with th app.post route. I have the endpoint for the get route but not having any luck finding the endpoint for the post. Been trying with Postman too without any success. The code is the one i provided and the enpoint, following the documentation, should be that one… But its not working. Is there something im missing?