Gotify client URL

What app is this about, and its version: Gotify 2.7.3~ynh1
What YunoHost version are you running: 12.1.36 (stable)
What type of hardware are you using: VPS bought online

Describe your issue

After installation, the URL to be used for clients (including curl test command) is not clear.

I’ve install gotify under <mydomain.tld>/gotify

I tried http://<mydomain.tld>/gotify , https://<mydomain.tld>/gotify, also various URL directely using port 35765 (which seems to be the internal port where nginx is redirecting the data stream…) but without any succes.

Thanks for your help !

Share relevant logs or error messages

Hi @clacos
When Gotify is installed on a subpath, the client URL must include /gotify in the API path.

  1. First, create an application in the web interface:
  • Log in to https://yourdomain.tld/gotify
  • Go to the “Apps” tab (top right corner)
  • Create a new application
  • Copy the token displayed (click the eye icon to reveal it)
  1. Then, test with curl:
curl "https://yourdomain.tld/gotify/message?token=YOUR_TOKEN_HERE" \
  -F "title=Test" \
  -F "message=Hello World" \
  -F "priority=5"

Push messages · Gotify

So the correct URL is: https://yourdomain.tld/gotify/message?token=
Don’t use the internal port (35765) directly — nginx handles the redirection.

Hi,

I tried this but I’m not sure it worked, and I can’t see my message in the webUI.

$ curl -X POST "https://www.mydomain.tld/gotify/message?token=xxxxxxxxxxx" -F "title=my title" -F "message=my message"
<html>
<head><title>302 Found</title></head>
<body>
<center><h1>302 Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

Oh my bad !!!

It worked with <mydomain.tld>, but not with <www.mydomain.tld>, which is of course what I set up (I have both and maybe this is not such a good idea…).

The 302 Found response means nginx is redirecting your request, but curl doesn’t follow redirects by default.

Try adding the -L flag to follow redirects:

curl -L -X POST "https://www.mydomain.tld/gotify/message?token=xxxxxxxxxxx" \
  -F "title=my title" \
  -F "message=my message"

You’re right, it also works with -L and <www.mydomain.tld>.

Thanks !