Looking for Hubspot API Java Script professional to change to Private apps in a Zapier code

Job ID: 35281977

Budget: $10 – $30 USD

I have a Java Script code in Zapier that gets data from Hubspot using the API
Hubspot no longer supports the API process and switch to Private Apps

1.
https://developers.hubspot.com/changelog/upcoming-api-key-sunset

2.
https://developers.hubspot.com/docs/api/private-apps

This is the code to fix:
-----------------------------
const emailPayload = {
"engagement": {
"type": "EMAIL"
},
"metadata": {
"from": {
"email": "support-forumnadlanusa.com",
"firstName": "Lior",
"lastName": "Lustig"
},
"to": [
{
"email": inputData.emailTo
}
],
"cc": [],
"bcc": [],
"subject": inputData.emailSubject,
"html": inputData.emailContent
}
}

const emailResponse = await fetch("https://api.hubapi.com/engagements/v1/engagements?hapikey=ebd43423-e649-43b8-9eb0-ffddcc7ca060", { method: "POST", headers: {'Content-Type': 'application/json'}, body: JSON.stringify(emailPayload) });
const email = await emailResponse.json();

const ticketPayload = {
fromObjectId: parseInt(inputData.ticketId),
toObjectId: email.engagement.id,
category: "HUBSPOT_DEFINED",
definitionId: 17
}
fetch("https://api.hubapi.com/crm-associations/v1/associations?hapikey=ebd43423-e649-43b8-9eb0-ffddcc7ca060", { method: "PUT", headers: {'Content-Type': 'application/json'}, body: JSON.stringify(ticketPayload)});

const dealPayload = {
fromObjectId: parseInt(inputData.dealId),
toObjectId: email.engagement.id,
category: "HUBSPOT_DEFINED",
definitionId: 11
}
fetch("https://api.hubapi.com/crm-associations/v1/associations?hapikey=ebd43423-e649-43b8-9eb0-ffddcc7ca060", { method: "PUT", headers: {'Content-Type': 'application/json'}, body: JSON.stringify(dealPayload)});

output = { ok: 200 }
Close

-----------------------------

If you know how to fix it answer with: "I know Private Apps in Hubspot JS!" si I will know you are not a bot.
Related categories: JavaScript JSON API Hubspot Zapier