https://discord.gg/botpress logo
Trigger Webhook Doesn't Receive/Register Payloadsf...
# 🤝help
b
CONTEXT: I'm currently building a chatbot that checks availability in google calendar (through make.com) to send the lead a date available for them to schedule. I'm sending the date they'd like to schedule to Make.com and I'm having issues: returning the available slots to schedule through the Webhook Trigger. I don't see where the webhook integration log the payload GOAL: I'm trying to understand how the Trigger works, is set up so I can get the info I need, and the chatbot keeps the conversation going with the information provided by Make... ATTEMPTED SOLUTIONS: I've seen in

https://www.youtube.com/watch?v=7s5VkgGu3V4&t=1081s▾

that I need the conversation ID to pass over the information, so I could send the info to the botpress webhook trigger, but is it necessary? I am having a hard time understanding the Trigger Webhook
l
@brash-greece-44635 I have built these can get on a call and walk you through it
b
I'd be glad to @limited-pencil-78283 but I'll have to poletly decline it if is not possible in the night (6:30pm - 7:00pm GMT -5) as I'm currently busy till that time. If possible, I'd appreciate a step-by-step list or more visual list with such steps... Thanks beforehand for the intention.
l
No worries, I have a few question though - is returning available slots via webhook your problem or via webhook you are not getting the payload?
I just re-read your post. And I'll just try calling Make through an execute node instead hahaha too much time without knowing how webhook triggers work
l
Yeah - I see you over engineered the solution. In your setup, are you getting payload at the webhook and is your scenarios working without errors?
b
haha yeah
but quick question... How do you actually structure you scenario so you call the webhook? I haven't figured out the way to "GET" the payload from Make...
l
that is pretty simple, end your make scenario with the webhook reply
b
hahaha I didn't really got my head around it
but I'll actually do it
b
Thanks Lijo. Really helpful
@limited-pencil-78283 quick question haha, wehre's stored the response from make? event.payload? or should I asign it in the Header del Webhook Response https://cdn.discordapp.com/attachments/1386739011736834158/1388181822609035486/image.png?ex=68600c91&is=685ebb11&hm=e17d13fda628f21f03476844f62c7ab532e183e65947232435d55655f08e965a&
l
event.payload
b
and should I set an execute code so the bot waits for the webhook response?
l
Yes
Use axios to make the call to the make.com endpoint and use "await" to ensure the code waits for the endpoint to respond
b
Thank you very much @limited-pencil-78283 you've been really helpful
l
What do you get in event.payload - this will work in Botpress
l
Oh no, I am sorry to have misled you. Since you are using axios.post. the response will be in the response const response= await axios.post(make.com url, headers, body) Console.log(response.data)
b
ohhh
but then the answer I'm receiving in Botpress from Make is not being identified as an Array, and apparently nor as object. And I can't force it to be array/object... webhookResponse = [webhookResponse]; nor process it with... mycodeValue.forEach((slot, index) {...} https://cdn.discordapp.com/attachments/1386739011736834158/1389030423992209638/image.png?ex=686322e4&is=6861d164&hm=649040f6b53dc0e25e76e65aeb9e0d91de2dfa57efa24c7ee3675e94d4cdf03a&
l
didn't quite get this part, are you looking get details of all events?
const response = event.payload const eventsArray = []; Object.entries(response.events).forEach(([key, value]) => { eventsArray.push({ type: key, value: value }); }); console.log(eventsArray);
b
I'm looking to store the data from the webhook response (events of the calendar), into a workflow variable I created (workflow.availableDT). But, the code you gave me is to convert the data from Make in an array?
l
We should do a call if you are free
b
I am right now
are you free?
l
Yep, 2 mins
9 Views