In order to send a notification that will be issued under a configured application in Gotify, the following curl command should do the job:
curl -i -X POST -H "Content-Type: application/json" -H "X-Gotify-Key: APPLICATION_TOKEN" --data '{ "message": "test", "title": "test" }' https://GOTIFY.TLD/message
where:
APPLICATION_TOKEN
is the application token configured using the Gotify interface,GOTIFY.TLD
is the hostname of the Gotify serverThe payload, namely the JSON string passed to the data parameter, is used here in-line, but it can also be sent from a local file.
With curl:
curl --form "file=@image.jpg;type=multipart/form-data" "https://SERVER.TLD/application/1/image?token=<YOUR_CLIENT_TOKEN>"
where:
image.jpg
is the name of an image file in the local directory,application/1
updates the application with the ID number 1
,YOUR_CLIENT_TOKEN
is a client token