Closed cmonty14 closed 6 months ago
Application are only allowed to POST to /message
, any other api gives 401. You can do this request:
$ curl -X POST 'http://localhost:8080/message' -H 'Authorization: bearer ACZPatHGzL-z3i9'
if it returns 401 the token is invalid, if it's 400 it's a valid token.
Running this command
curl -X POST "http://gotify.example.com:8680/message?token=ASaG-yml6So3yx-" -F "title=notification" -F "message=message from terminal"
is working as expected:
{"id":2,"appid":3,"message":"message from terminal","title":"notification","priority":1,"date":"2024-05-14T14:59:10.475177001+02:00"}
Okay, then there is no problem anymore?
Have you read the documentation?
You are setting up gotify in
Describe your problem I have defined an application in Gotify. How can I verify using
curl
syntax if the token is working correctly fetching data via API?Any errors, logs, or other information that might help us identify your problem Running this command
curl -L -k -H 'X-Gotify-Key:ASaG-yml6So3yx-' http://gotify.example.com:8680/client
orcurl -L -k "http://gotify.example.com:8680/client?token=ASaG-yml6So3yx-"
fails with error: {"error":"Unauthorized","errorCode":401,"errorDescription":"you need to provide a valid access token or user credentials to access this api"}