How to receive data back from Make.com to Botpress...
# 📖tutorials
q
This is not a detailed Make.com tutorial, so I assume that everyone interested already knows the basics. Create a new scenario with two webhooks, the first being a Custom webhook and the second a Webhook response.
The second webhook body is the data you want to send back to Botpress, here I have a message "test-123".
In your chatbot Execute code card, use this:
Copy code
js
const webhookUrl = 'https://hook.eu2.make.com/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
try {
  const response = await axios.post(webhookUrl)
  const webhookResponse = response.data
  console.log(webhookResponse)
} catch (error) {
  console.log(error)
}
t
Can you make a video pic how to do this?
q
Then you can console.log the response from the Make.com webhook
you can download the chatbot file from here
I was kind of hoping that @flat-plumber-75402 would create it with Vimeo 💎 🙏
or @crooked-ram-87124 can fit it into his busy schedule 🛠️ 🦸
"This is not a Make.com tutorial" Obviously, in a real use case you would want to receive real data, so you put all that between those two webhooks in Make.com
c
yeah i have make and can totally make something on the topic
w
Great tutorial @quick-musician-29561, I've been dabbling with Make so thanks for posting
a
Those the make webhook response run custom JavaScript code like the execute card in botpress.
c
You two @quick-musician-29561 @crooked-ram-87124 are the best!!!!! 🥳
b
Mine was working until I added another process between the webhooks, then it just returns 'Accepted', and now even if I delete the process I added, it still doesn't work, could you help me please
q
Did you solve it already, or should we try to find the error together? ⚡
b
no I couldn't solve it
a
I'm having the same issue
b
@quick-musician-29561 please help
q
Ok, I can try to reproduce such an error 🫡
b
yeah but with paypal it didn't work
should I send you my bot and make automation?
q
Hi, today I'm available 🫡 It's good that you mentioned the error is with PayPal, that I haven't tried before. Normally if I disconnect modules, it can answer only 'Accepted' like you said, make.com accepted the data but the last webhook module didn't send anything back. But when I connect those again, I starts to work. So maybe there is some small error with how the JSON data needs to be organized in paypal module. If you're still facing the same issue, I can log in there and help you to find the error.
b
from what I ssaw here, the module "Custom Webhook" always sends an "Accepted" message, and I'm recieving that instead of the Webhook Response
q
yes, for me it has always meant that there is a small error in one of the modules, and the data doesn't go all the way to the last webhook (i.e. through the whole make.com scenario)
b
It goes through the whole scenario, when I try "Run Once", I can see the path and I see that the payment link is there. Maybe my code for recieving the webhook response is wrong?
q
You can share your make.com scenario with me if you want, that's one way we have worked together with other bot builders
b
how can I share it with you?
q
You can export it in make.com, then send DM that file to me
b
okay, when I get home (soon) I'll send you
q
Click those three little dots ... and Export Blueprint, then you'll get the file
It's 9:50 PM here, so I'll start with that in the morning
b
ok, sending you
q
☕ 🛠️ It's early Saturday morning and we have managed to solve two Make.com related problems already. It seems that most of the errors in Make.com projects are minor typos, or then additional code is needed in the Execute code card to get the desired result. So most of the times (if not always) it's not any Botpress or Make.com related issue at all.
@bland-advantage-2085 your case is the most difficult because I don't have the exact data and chatbot, but one way to solve this is that I clone your make.com schedule and send you the my webhook address. Once you send the sample data there one time, I can start debugging ⚡
also I don't have all the accounts connected to your project
w
Hi! Did anyone manage to find the solution for the strange change or behaviors from “test-123” to just “accepted”? I am also having this issue..
w
Hi @wide-market-36754, I think this post is related to https://discord.com/channels/1108396290624213082/1121494527727902891/1281143506903105620 there's nothing of strange your make.com scenario must starts with a Custom webhook and ends with a Webhook response as @quick-musician-29561 wrote. if Webhook response body is empty or there's a problem in flow then botpress receives a standard response
Copy code
json
{"success":true,"response":"Accepted"}
otherwise
Copy code
json
{"success":true,"response":"vegetable"}
All your tasks must be connected, in Webhook response body field write or choose the name of variable that contains the string you want to return for example "vegetable". In botpress to read the response field only
Copy code
js
const webhookResponse = response.data
// set a local variable
const reply = webhookResponse.response
// set a workflow variable
const workflow.reply = webhookResponse.response
w
Thank you! When I change the webhook response body to a make.com variable, however, it still just gives me "Accepted" over in botpress...any idea of what the problem could be? Or is it impossible to have make.com send a variable body back to botpress? I can't find any tutorial speaking of this, I'm so confused... 😦
w
I attach a blueprint export of an example to hoe return a json structure in Make webhook. Importing is available on all plans, and you should see a menu pop open, in editor, when you click on the 3 dots at the bottom. When you click on
Body
field of webhook response a selector appear and hrlp you to search and select your variable. https://cdn.discordapp.com/attachments/1180929476624912394/1282602352267759646/webhook_output_a_json.json?ex=66dff406&is=66dea286&hm=c0f184087d83de579dedc363801ffe7fd9aa0f33ae02fdc4a270b270917f3df9&
w
Thank you for sharing this. I integrated the intermediate json module you used here, but the result seems to be the same...I'll attach some screenshots. So botpress sends over the variables, which Make uses to create a new spreadsheet from a template, substituting certain cells for the veriables. It then returns another cell (dependent on the new variables) to make- and that has worked so far- but even when I add the json module, it just returns "Accepted" (in the 5th screenshot you can see the bot would say "is 225", as we can see in the 6th screenshot that 225 is the returned value)...still not sure about what to do, would anyone happen to know what I'm doing wrong? https://cdn.discordapp.com/attachments/1180929476624912394/1283301358648164375/Screenshot_2024-09-11_at_06.31.44.png?ex=66e27f06&is=66e12d86&hm=35933b91aa26c75e0cf6825972a70ded464c1423eaedcdd8b2b70187c74a189b& https://cdn.discordapp.com/attachments/1180929476624912394/1283301359072055306/Screenshot_2024-09-11_at_06.32.11.png?ex=66e27f06&is=66e12d86&hm=f8a990ff463e889663e3c9e0f2f1f1579ce15017017d832c27ff93d2f25ac7e8& https://cdn.discordapp.com/attachments/1180929476624912394/1283301359579561984/Screenshot_2024-09-11_at_06.32.41.png?ex=66e27f06&is=66e12d86&hm=ca3237a6a749f03a6e02b1cb8f34bbeabbff5f0e1c7b2db936aef0cac2996c57& https://cdn.discordapp.com/attachments/1180929476624912394/1283301360032284735/Screenshot_2024-09-11_at_06.32.48.png?ex=66e27f06&is=66e12d86&hm=b9f56fe3aec3181e2157157ee1697667000c31865cbdba76f43931d1196abaf6& https://cdn.discordapp.com/attachments/1180929476624912394/1283301360397455370/Screenshot_2024-09-11_at_06.38.58.png?ex=66e27f06&is=66e12d86&hm=8c032bb36fa0edf09a32f87632695b444152aa191d5df485bfa0d2eae34505d9& https://cdn.discordapp.com/attachments/1180929476624912394/1283301360783069214/Screenshot_2024-09-11_at_06.39.22.png?ex=66e27f06&is=66e12d86&hm=0e888c7d2aa7760664e352590eaf32c7020f57c96ab2f5d34a0b459065caeac7&
w
Have you try make workbook with Postman or similar tool?
to verify what it is the response, maybe the problem is in make not in botpress
8 Views