Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Format of curl examples

The curl examples will use this format:

curl -s \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
'http://<unimus-address>:8085/api/v1/<API-path>' | json_pp

Explanation:
-s  : makes curl run silent - not show request processing, etc.
-H : adds HTTP headers needed to communicate with Unimus API

We will then pass the output to json_pp which will format the JSON received from the Unimus API.

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

curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<unimus-address>:8085/api/v1/<API-path>"

 

You will need to substitute the values inside <...> for your actual values:
<token>                  : change this for your Unimus API token
<unimus-address> : change this for the actual address of your Unimus server
<API-path>             : change this for the API path you wish to call

Examples

Get current status of your Unimus server

curl call:

curl -s \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
'http://<unimus-address>:8085/api/v1/health' | json_pp

 

Output:

{
   "data" : {
      "status" : "OK"
   }
}

Add a device into Unimus

  • No labels