Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column
width30%

Table of Contents
maxLevel3
 

Column
width70%

Overview

Basics

The Unimus API is a JSON based RESTfull API. It utilizes common HTTP methods such as GET, POST, PATCH and DELETE in order to identify action you want to perform.

When submitting a request that contains a body you must include a header for Content-type that specifies application/json.

API Version 1 is supported by Unimus 1.6.x and older. API version 1 is no longer supported in latest Unimus releases.

Security

Every request has to include Authorization header following Bearer scheme as shown below.

Panel
borderColorgrey
borderStylesolid

Authorization: Bearer <token>

Log into your local Unimus instance and navigate to User management > API tokens section to create new token.

Returned data format

All responses are returned as JSON. If a response can ever contain a single item it will be formatted as follow:

Panel
borderColorgrey
borderStylesolid

{

"data": {
"some key": "some value",
"another key": "another value"
}

}

Multi-item responses are paginated automatically. The maximum amount of items that can be returned in a single query is 50, default is 20. You may specify the number of items to be returned in response by appending a query parameter size.

You may specify the page you wish to view by appending a parameter page, default is 0. Multi-item responses are formatted as follow:

Panel
borderColorgrey
borderStylesolid

{

"data":  [
  {
"some key": "some value",
"another key": "another value"
},
{
"some key": "some value",
"another key": "another value"
}
 ],
"paginator": {
"totalCount": 12,
"totalPages": 6,
"page": 0,
"size": 2
}

}

All successful response are sent with an HTTP response code 2xx.

Failure response format

If an API response fails, it will be sent with a non-2xx response code and JSON in the following format:

Panel
borderColorgrey
borderStylesolid

{

"timestamp": 1511904038642
"code": 400
"error": "Bad Request"
"message": "This is why it fails"

}

The HTTP status codes currently returned by the API are 400 if request syntax is wrong, 401 if request is unauthorized, 404 if requesting with item ID and item is not found or request path is not supported by the API, 405 if the method is not supported, 415 if media type is not supported, 503 if request can not be served. Any internal application errors will respond with a 500 code and we will be grateful if u report them to us. 

...