Loading...
Started by Ryan Tse • Jul 4, 2025 11:17 PM
Total Replies
2
Participants
2
Activity
Quiet
Duration
11:17 PM
Thread starter
async function AssignTask(managerId, taskId) {
try {
console.log(`taskId: ${taskId}`);
console.log(`managerId: ${managerId}`);
const headers = {
'Authorization': `Bearer ${process.env.FBCCommerceKey}`,
'Content-Type': 'application/json'
};
const properties = {
"hubspot_owner_id": managerId
};
const SimplePublicObjectInput = {
properties
};
try {
await axios.patch(
`https://api.hubspot.com/crm/v3/objects/tasks/${taskId}`,
JSON.stringify(SimplePublicObjectInput),
{ headers }
);
} catch (e) {
e.message === 'HTTP request failed'
? console.error(JSON.stringify(e.response, null, 2))
: console.error(e)
}
} catch (e) {
console.error("Error AssignTask:", e);
}
}2 messages in thread