skirl

curl

One command sends a message to a topic: the quickest way to try Skirl, and all a script needs when it already has curl.

Setting it up#

In the app this command is under Connect a system → curl, or a topic's Send to this topic tab, with your address, the topic and a token filled in; New token makes the token.

One command, for a quick try or a script that already has curl.

curl https://notify.example.com/backups \
  -H "Authorization: Bearer tk_replace_with_your_token" \
  -H "Title: Nightly backup finished" \
  -d "pve-01 → offsite. 14 VMs, no errors."

The command is written for a shell on Linux, macOS or WSL: the \ at the end of a line carries it on to the next. Skirl answers with the message it stored, as one line of JSON. Skirl's tests run this command as the app shows it.

More headers set the priority, tags, a link to open and the rest: Title, priority and tags. In a script that should notice when Skirl says no, use the function on Shell scripts, which makes curl fail on a refusal.

What a message looks like#

Nightly backup finished pve-01 → offsite. 14 VMs, no errors.

Priority 3

A message that sets no priority gets 3, the default.

When nothing arrives#

curl prints Skirl's answer, so the reason is on the screen. To see the status line as well, add -i:

curl -i https://notify.example.com/backups -H "Authorization: Bearer tk_replace_with_your_token" -d "Testing from curl"

A refusal ends with a line such as:

{"code":40101,"http":401,"error":"unauthorized"}
  • 401 unauthorized: the token is wrong, revoked or expired. Make a new one with New token, or Rotate the one you have, and paste it in again.
  • 403 forbidden: the token may not send here. It is limited to another topic, the topic name is misspelled or the topic does not exist (a token limited to one topic never makes a new one), or the command sends no token at all.
  • 404 page not found: the address is not a topic's. It is your server's address, a / and the topic name, such as https://notify.example.com/backups, with no / at the end.
  • 413: the file is larger than this server takes: Attachments: limits.
  • 429: too many messages too fast, or too many failed sign-ins from this address: Rate limits.

When curl gets no answer at all, it says why instead:

curl: (6) Could not resolve host: notify.example.com

That, or a wait that ends in a timeout, means this machine cannot reach the address. SSL certificate problem means it does not trust the server's certificate. What to check for each: A sender gets no message through. Every error code: Error messages.

This page on GitHub