creamy-zebra-35770
07/16/2024, 7:01 AMbreezy-megabyte-18599
07/16/2024, 2:45 PMlet data = outgoingEvent
//if your variable is not already available in the event object
data.MyVariable = workflow.MyVariable // or user..MyVariable etc
let config = {
method: 'post', //or whatever verb you are using at your API endpoint
url: 'https://yourapi.com/api/YourEndpoint',
headers: {
accept: '*/*',
'Content-Type': 'application/json'
},
data: data
}
axios
.request(config)
.then((response) => {
//Do whatever you want here, this just logs the response to the console.
console.log(JSON.stringify(response.data))
})
.catch((error) => {
//If you still don't have success then log what error is occurring when calling your API
console.log(error)
})
Hope that helps.creamy-zebra-35770
07/19/2024, 6:49 AM