Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

APIv3

For APIv3, the Swagger documentation offers interactive curl examples:

Image Added

Please use the Swagger docs to explore the APIv3:
https://download-unimus.netcore.software/api-v3-preview/

APIv2

For APIv2 curl examples, please see below.

Format of curl examples

The curl examples will use this format:

Code Block
curl -ssS \
-H 'Authorization: Bearer <token>' \
-d '<data>' \
'http://<unimus-address>:8085/api/v1v2/<API-path>' | json_pp

Explanation:
-sS  : makes curl run silent - not show request processing, etc., but still properly show errors
-H : adds HTTP headers needed to communicate with Unimus API
-d  : data needed for various requests - not always needed

...

The above curl command is the same as if written on one line (without the use of json_pp here):

Code Block
curl -sS -H "'Authorization: Bearer <token>" "' -d '<data>' 'http://<unimus-address>:8085/api/v1v2/<API-path>"' | json_pp

You will need to substitute the values inside <...> for your actual values:

...

curl call:

Code Block
curl -ssS \
-H 'Authorization: Bearer <token>' \
'http://<unimus-address>:8085/api/v1v2/health' | json_pp


Output:

...

curl call:

Code Block
curl -ssS \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{"address":"<address>"}' \
'http://<unimus-address>:8085/api/v1v2/devices' | json_pp


Output:

...

curl call:

Code Block
curl -ssS \
-H 'Authorization: Bearer <token>' \
'http://<unimus-address>:8085/api/v1v2/devices/findByAddress/1.1.1.1' | json_pp

...

curl call:

Code Block
curl -ssS \
-H 'Authorization: Bearer <token>' \
-X PATCH \
'http://<unimus-address>:8085/api/v1v2/jobs/backup?id=57' | json_pp


Output:

...

curl call:

Code Block
curl -ssS \
-H 'Authorization: Bearer <token>' \
'http://<unimus-address>:8085/api/v1v2/devices/57/backups/latest' | json_pp

...