A quick tool to send a json payload to a webhook
The Webhook Tool is a command-line application written in Go that sends a JSON payload as a POST request to a webhook destination URL. It accepts key-value pairs as input and converts them into JSON format.
This little tool solves the small annoyance of having to use Powershell on Windows to communicate with webhooks, and getting command line popups when those commands are executed. Since this can be compiled as a UI application on Windows it will not show a terminal popup. It also makes sending JSON much easier by handling the formatting for you.
To use the Webhook Tool, follow the instructions below:
-
Download the compiled executable for your operating system from the Releases page.
-
Run the tool from the command line with the following parameters:
webhook.exe -url [webhook_url] -string2json [key-value pairs]
Replace
[webhook_url]
with the destination URL of the webhook. Replace[key-value pairs]
with an unlimited number of key-value pairs to be included in the JSON payload. Each key-value pair should be separated by a space.Example:
webhook.exe -url https://example.com/webhookaddress -string2json key1 string1 key2 number2 key3 %RANDOMNUMBER%
-
Provide the necessary details for the parameters:
-url
is the destination URL of the webhook.-string2json
is the key-value pairs to be converted into JSON format.
-
Review the output for success or error messages.
The Webhook Tool has the following dependencies:
- Go programming language (version 1.16 or later)
- Standard Go libraries:
encoding/json
,flag
,fmt
,log
,net/http
, andstrings
If you prefer to build the Webhook Tool from source, follow the steps below:
-
Clone the repository:
git clone [repository_url]
-
Navigate to the cloned repository:
cd webhook-tool
-
Build the application:
go build -ldflags "-H=windowsgui" -o webhook.exe webhook.go
-
Follow the usage instructions mentioned above to run the tool.
Contributions are welcome! If you have any suggestions, improvements, or bug fixes, please submit a pull request.
This project is licensed under the GNU General Public License v3.0. Please see the LICENSE file for more details.