Using Curl in the CMD To send a Discord webhook

Viewed 11038

I want to send a Webhook Using The CMD Command line Curl However the command i made:

curl -X POST --data '{"content": "Posted Via Command line"}' --header "Content-Type:application/json" discord-webhook-link

Returns This Message

curl: (3) [globbing] unmatched close brace/bracket in column 24

{"message": "400: Bad Request", "code": 0}

Is there a way I can send a Discord Webhook message via the command Line?

2 Answers

the following syntax is working for me, maybe give it a try.

curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"Posted Via Command line\"}" discord-webhook-link

Discord Webhook is the easiest way to send message to a discord, but it will send the message to one specific channel. You need to create a server, click on engine icon of the channel, go to integrations, create one webhook and copy the URL of webhook.

You can "<@" + ID_User + ">" to mention someone if you have more users on the channel (ex: <@610973627472746>).

This command works on linux and mac to send message:

curl -i --trace-ascii - -X POST https://discord.com/api/webhooks/7842846283746/D3SxBhkaz7sCEO9X9OfII03aj-UWNnuNmUlSRpni0mxiBeszzevCSNhpWOFsOSHkGHVM -H "Content-Type:application/json" --data '{"content": "Hello <@610973627472746>"}'
Related