I want notification on my discord app after completing every scan in sonarqube. I have tried to configured my discord webhook URL in sonarqube webhook option but it getting 400 error code after scanning the code and not sending notification.
Steps i tried :
sonarqube > Administration > Configuration > Webhooks
.But i am getting below error.
Error
:
Last delivery of Spidey Bot
Response: 400
Duration: 186ms
Payload: .....
It turns out, request body format which SonarQube sends to Discord is not acceptable. It leads to bad request error. Below is logged response from Discord,
{ "message": "Cannot send an empty message", "code": 50006 }
To successfully post the message it must be in the specific format documented https://discordapp.com/developers/docs/resources/webhook#execute-webhook
The solution to this could be a mediatory URL which parses the request body and hits Discord Webhook with excepted body params.