Can't make a RocketChat Webhook work from Prefect Cloud - How should I compose the body?

So we’re using RocketChat in our company, and we have multiple inbound webhooks to send notifications to some channels. This usually happens via python (from our python framework) or curl (via bash scripts) and works like a charm.

In principle from Prefect Cloud I can define a WebHook block that does the same job. However, I can’t find a way to compose the request body in a way that works.

This works (RocketChat expects the message under “text” key):

curl -X POST $URL -H 'Content-Type: application/json' --data '{"text": "debug"}'

This is how I define the WebHook and Automation are defined:

Result? RocketChat shows an empty message, meaning it got the notification but the body is nothing valid for display.

What am I doing wrong? I tried so many different things, this is so frustrating :frowning:

Hi @Andrea_Palazzi and thanks for the issue. Currently, the body in the automation is wrapped in a “message”: key, so if rocketchat is expecting a top level “text”: key, this unfortunately wont work. That said I think we should just remove the message key entirely and let users directly pass in webhook bodies with more control, so I’ve filed this issue Remove "message" key from the call webhook automation action · Issue #10443 · PrefectHQ/prefect · GitHub.

Thanks @Will_Raphaelson for the quick response, good to know that it was not me then :slight_smile:

Looking forward for this to being fixed to have working RocketChat notification!

Being this a custom WebHook, makes sense to me to leave to the user complete control over the request body.

This is completed via Remove "message" key from the call webhook automation action · Issue #10443 · PrefectHQ/prefect · GitHub