-
Notifications
You must be signed in to change notification settings - Fork 0
REST API
The API documentation is accesible visiting https://yourserver:1323/swagger/index.html
.
Note: you may have to add your CA.pem file to your trusted certificates so your browser doesn't complain about security.
Here's the web page offering API documentation.
Glim uses JWT tokens to authenticate users so you'll have to request a token from the API using the /v1/login endpoint. Using Glim's Swagger server you can do it following these steps:
-
Go to the login endpoint and click on it
-
Click the "Try it out button". Replace "string" with your username and password to log in and click on "Execute".
-
If your credentials are fine and Glim's working as expected you'll see the access token that you can use in your next requests
-
Now you can copy that token and use it to authenticate your requests. In Swagger you can click on the padlock and a form will be offered to enter that token. Finally click on Authorize to set the authentication token.
⚠️ WARNING: You'll have to put "Bearer " (that's Bearer followed by space) before the token. This is needed as Swagger 2.0 can't use JWT directly. Unfortunately the swag library used by Glim doesn't support OpenAPI 3.0, so this workaround must be used. -
Once you've entered the token, click on the "Close" button. Now you'll see that the padlock icon shows a closed state and your token will be sent with your requests.
The Glim Project - 2022