I’m trying to make a web hook to receive stripe events, however they want to do a challenge response before I can add the web hook URI. How would I return a json key provided in the POST body in the body of the response?
They expect 1zp6ZmZ5eTOeJthMWRe9YTRl2EPMREvlv3OZrcjKwg8TVaTnNp7z back
Sorry for the late answer! It took me a while to come up with a way to do it currently without changing the code. It can be done with returning binary data.
Here a simple example workflow which receives the challenge via “GET” (to test easily) and the query parameter “challenge” returns it:
So if test and you call the workflow like this:
It should then return “test123” (without quotes)
Hey Jan, I wanted to thank you for writing that, definitely went above and beyond there.
Sorry to bring this back, trying to do exatly same thing here but getting this error:
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined
at Function.from (buffer.js:293:9)
at new Buffer (buffer.js:253:17)
at Object.base.construct (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/contextify.js:539:31)
at Object.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes:9:2)
at NodeVM.run (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/main.js:520:23)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Function.node.js:64:31)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:554:37)
any advice is really appreciated !