So, with my limited scripting and Java skills I've been trying to set up a script that will call a webhook so I can later trigger something there. I managed to set up the basic ping but I came across the ideal of sending some record ID's I need which can save me a step later on.
My error is surrounding inputConfig and how to parse it into the JSON body (I guess?)
The error most likely lies in line 4 and 5, hopefully it's understandable what I'm trying to get done. For line 4 and 5 I also tried "" but that simply sends over the whole thing and not the input I setup in the script (picture attached below)
let inputConfig = input.config();
let body = {
"ping": "Survey Ping",
"company_id":${inputConfig.contact_id},
"contact_id":${inputConfig.company_id}
}
let response = await fetch('https://n8n.joinowners.co/webhook-test/tally-onboardinglaunch-survey', {
method: 'POST',
body: JSON.stringify(body),
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
},
});
console.log(await response.json());