This repository contains examples of how to use the Ave Web Api with swagger-2.0 definition.
- Clone this repository
- Choose one of the examples
- Fill your
ApiKey
orusername
andpassword
in the example - Run the example
WebApi supports two types of authentication. Api key and session based authentication. Both are interchangeable using
same header name X-Api-Key
.
- Generate a new Api Key in the Ave2 Client
- Add the Api Key header to the requests
X-Api-Key
-
Post
to the auth endpoint/auth
with the following body{ "Name": "YOUR_USERNAME", "Password": "YOUR_PASSWORD" }
Both username and password are the same as you use to login to the Ave2 Client.
-
Add the session id to the requests header as
X-Api-Key
- Recommended for long running processes, like a service that runs in the background.
- Valid until changed or revoked in the Ave2 Client (user management).
- Recommended for short running processes, like a web application with user access.
- Valid only for certain amount of time. If you get a
401
code (Unauthorized) in response, you need to re-authenticate.
Using Swagger/OpenApi code generators is a great way to get started with the WebApi. It will generate all the models and client code for you.
- NSwag Studio (C#, Typescript ...)
- OpenAPI Generator (Javascript, Typescript, Java, C#, Python, Kotlin...)
For testing we recommend using Postman. It is a great tool for testing and documenting APIs
and was the most consistent among other. You can easily import
our api into Postman by using the following link:
https://www.ave-system.com/api/v1/swagger.json
Warning when testing endpoints with SwaggerUI 2.0 we found that SwaggerUI 2.0 corrupts binary data and files. So we recommend using Postman or newer versions of SwaggerUI.
Any contributions to this project are welcome. Please see the open issues. You can contact us at support-ave@geovap.cz