Method for Managing License

To manage license, execute requests using the "licenses: API method (determine administrator token before executing the request):

curl -v -X POST "<IP address or DNS server name>/api/v2/licenses/" –header "accept: application/json" -H "Authorization: Bearer <administrator token>" -F 'file=@<absolute path to license file>/<license file name>.prm'

The example of response:

{
    "id": 3,
    "max_devices": 5,
    "max_users": 5,
    "max_devices_per_user": 5,
    "requests_per_minute": -1,
    "end_time": "2022-12-31",
    "system_id": "64329645253",
    "license_id": "e8e3647f-04a8-4696-920c-c72bb34a7ad8",
    "data_sources": null
}

curl -v '<IP address or DNS server name>/api/v2/licenses/' --header 'Content-Type: application/json' -H 'Authorization: Bearer <administrator token>'

The example of response:

{
    "results": [
        {
            "id": 1,
            "max_devices": 5,
            "max_users": 5,
            "max_devices_per_user": 5,
            "requests_per_minute": -1,
            "end_time": "2022-12-31",
            "system_id": "64329645253",
            "license_id": "e8e3647f-04a8-4696-920c-c72bb34a7ad8",
            "data_sources": null
        },
        {
            "id": 2,
            "max_devices": 7,
            "max_users": 7,
            "max_devices_per_user": 7,
            "requests_per_minute": -1,
            "end_time": "2022-12-31",
            "system_id": "64329645253",
            "license_id": "be91a026-9edc-4782-a8d4-2653d8ac2a66",
            "data_sources": [
                "FAP_WEB",
                "POSTGRES"
            ]
        }
   ]
}

Values of parameters contain the following information about license:

curl -X POST -v '<IP address or DNS server name>/api/v2/licenses/notifications-settings/' --header 'Content-Type: application/json' -H 'Authorization: Bearer <administrator token>' -d '{
    "use_email": <notification method (0-to logs or 1-via e-mail and to logs)>,
    "days_before": <action days left>,
    "period": <repetition in days>,
    "device_rate": <devices left in percentage>,
    "user_rate": <users left in percentage>
}'

The example of response:

{
    "use_email": 1,
    "days_before": 2,
    "period": 3,
    "device_rate": 15,
    "user_rate": 15,
    "last_run_at": null,
    "license_error_status": "{}"
}

curl -v '<IP address or DNS server name>/api/v2/licenses/notifications-settings/' --header 'Content-Type: application/json' -H 'Authorization: Bearer <administrator token>'

The example of response:

{
    "use_email": 0,
    "days_before": 5,
    "period": 5,
    "device_rate": 10,
    "user_rate": 10,
    "last_run_at": null,
    "license_error_status": "{}"
}

curl -X DELETE -v '<IP address or DNS server name>/api/v2/licenses/<identifier or requested license>/' --header 'Content-Type: application/json' -H 'Authorization: Bearer <administrator token>'

In the <requested license identifier> substitution use value of the id parameter returned on getting information about licenses.

The example of response:

204

See also:

Server API