Jul 21, 20222:16 AM - edited Jul 21, 20222:20 AM
Participant
Unable to post data to Custom objects from Workflow using the API
SOLVE
Hello,
I'm trying to post the record to Custom Object from Workflow -- Custom Code Action. I'm using the POST API available here (POST/crm/v3/objects/{objectType}). I'm facing following issue while doing the same:
2022-07-21T06:02:34.925Z ERROR TypeError: Cannot read property 'create' of undefined
at Object.exports.main (/var/task/file.js:26:60)
at Runtime.exports.hubspot_handler [as handler] (/var/task/hubspotHandler.js:6:21)
at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)
It seems there is some issue with the API.
Here is my code snippet:
const hubspotClient = new hubspot.Client({ accessToken: process.env.ACCESSTOKEN });
This solution worked for me. Could you please share a link wherein I can get all the working endpoints? This is a bit of time consuming to wait for an valid API to implement the required usecase. It would be really helpful if the docs get updated asap since lot of time is invested in getting the valid API.
Awesome! Happy it worked. You can use the GitHub repo as an indication of how to build the endpoint. The discovery folder is the 'base'. And if you navigate to the crm folder that would you mean you are looking at hubspotClient.crm, if you navigate to the contacts folder, you are looking at hubspotClient.crm.contacts
But I agree, the docs need an update 🙂
Learn more about HubSpot by following me on LinkedIn or YouTube
✅ Did my answer solve your issue? Help the community by marking it as the solution.