We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Jan 24, 2022 3:07 PM
Hi there,
I've only recently started using HubSpot, and have been familairising myself with the custom functions available.
I've come unstuck with regard to processing API responses via a Customer Workflow Action, and the documentation doesn't give any real examples or pointers to help.
I have a workflow set up and have managed to POST custom API calls without any issues, using data from HubSpot .
However, two issues I have having.
1 - authenicated the call to the API - unclear how this is set (might be a rookie error in the PRE_ACTION_EXECUTION but I did try adding httpHeaders there but that stopped the API call happening at all
2 - taking data form the response for use within HubSpot
I also could not get the API endpoint
My custom action request:
{
"actionUrl": "https://xtractor.free.beeceptor.com/my/api/path/4",
"inputFields": [
{
"typeDefinition": {
"name": "childcompanyValue",
"type": "string",
"fieldType": "text"
},
"supportedValueTypes": [
"STATIC_VALUE"
],
"isRequired": true
}
],
"outputFields": [
{
"typeDefinition": {
"name": "client_ip",
"type": "string",
"fieldType": "text"
}
}
],
"labels": {
"en": {
"actionName": "Dave Test with Output Fields 1937",
"actionCardContent": "Output fields",
"inputFieldLabels": {
"childcompanyValue": "Company Name"
},
"outputFieldLabels": {
"client_ip": "Client IP"
}
}
},
"functions": [
{
"functionType": "PRE_ACTION_EXECUTION",
"functionSource": "exports.main = function(event, callback) { return callback(transformRequest(event)); }\nfunction transformRequest(request) { return { webhookUrl: 'https://xtractor.free.beeceptor.com/my/api/path/3', body: JSON.stringify(request.fields), contentType: 'application/json', accept: 'application/json', httpMethod: 'POST' }; }"
}
]
}
Jan 27, 2022 9:42 AM
@Teun !
Mind lending a hand here?
![]() | Make sure to subscribe to our YouTube channel where you can find the HubSpot Community Developer Show |