Tyler
Tyler6mo ago

Accepting raw body

I have webhooks submitting data that is not structured well. Is it possible to just accept the entire POST body as a single variable? Something like:
export async function main(hook: string) {}
export async function main(hook: string) {}
Example input:
event=lead_added
data[source]=widget
data[lead][last_name]=N/A
event=lead_added
data[source]=widget
data[lead][last_name]=N/A
When I run it, it says the input arguments are this, but I can't define these as the parameter names in the function, it's invalid javascript.
export async function main(
'data[lead][last_name]': string,
'data[source]': string,
event: string,
) {
export async function main(
'data[lead][last_name]': string,
'data[source]': string,
event: string,
) {
2 Replies
Tiago Serafim
Tiago Serafim6mo ago
Webhooks | Windmill
Webhooks are a way to interact with Windmill using standard web technologies.
Tyler
Tyler6mo ago
Thanks!