I’m receiving an ‘’ error when trying to update a company using Private App credentials.
I’ve looked through similar discussions and havent found anything that relates to my issue.
Im using the following to import company data to my application, which is working fine:
const hubspotHeaders = {
headers: {
'Authorization': `Bearer ${process.env.HBSSANDBXAPPK}`,
'Content-Type': 'application/json'
}
};
const fetchData = (url) => {
return axios.get(url, hubspotHeaders).then(response => {
console.log(response.data)
})
.catch(function (error) {
console.log(error)
});
};
fetchData(`https://api.hubapi.com/crm/v4/objects/companies?${hapikeyParam}`);
However, when I change the API endpoint and request to ‘patch’, I receive the error:
const hubspotHeaders = {
headers: {
'Authorization': `Bearer ${process.env.HBSSANDBXAPPK}`,
'Content-Type': 'application/json'
}
};
const properties = {
"seo_revenue": 0
};
const putData = (url) => {
return axios.patch(url, properties, { hubspotHeaders }).then(response => {
console.log(response.data)
})
.catch(function (error) {
console.log(error)
});
};
putData(`https://api.hubapi.com/crm/v4/objects/companies/01010101010101`);
“message: 'Authentication credentials not found. This API supports both API Key and OAuth 2.0 authentication and you can find more details at Accounts Dashboard | HubSpot”
Am I missing something that PATCH requests require? Seems strange that the GET requests works but the PATCH request fails with an error.
Any information regarding this issue would be much appreciated, thank you.