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 2 is supported by Unimus 1.7.x and highernewer. API version 1 is no longer supported.

API changes since version 1

  • Backup
    • renamed field createTime to validSince, represents the time the configuration has been retrieved from the device for the first time
    • added field validUntil,  represents the time the configuration has been retrieved from the device for the last time
  • Device
    • removed fields port, connector, credential
    • added field connections, which is an array of discovered connections, each connection entity contains fields type (SSH,TELNET), port, credentials (array of all usable credentials) and enablePassword (if not same as login password).
    • entity graph attribute nodes for fetching device credentials credential,cred,c are no longer supported
    • added entity graph attribute nodes for fetching connections connections, conn, c.
  • Run job - backup device
    • removed field undiscovered, which represented the number of un-discovered devices excluded from backup job
    • added field sentForDiscovery, which represent the number of un-discovered devices sent for discovery (and backup if discovery will succeed)

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:

Code Block
languagetext
{
   "data":{
      "someKey":"someValue",
      "anotherKey":"anotherValue"
   }
}

 

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:

Code Block
languagetext
{
   "data":[
      {
         "someKey":"someValue",
         "anotherKey":"anotherValue"
      },
      {
         "someKey":"someValue",
         "anotherKey":"anotherValue"
      }
   ],
   "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:

Code Block
languagetext
{
   "timestamp":1511904038642,
   "code":400,
   "error":"Bad Request",
   "message":"This is why it fails"
}

 

The HTTP status codes currently returned by the API are 301 if the API version is not supported 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. 

...