Authentication with API Key


curl

Introduction

Welcome to Asset Manager REST API. Our REST API is designed for customers who want the entire experience of Asset Manager via API: Configuration of Asset Manager box, Initializing Indexing, Monitoring and Accessing Results to enhance their Security/Cyber Situational Experience.

Everything that you can perform via Asset Manager CLI or Web-based GUI, can also be accomplished using this API.

The REST API uses JSON, XML and in some cases XJSON over HTTP. It supports HTTP verbs such as GETPOSTPUT, and DELETE.

API Endpoint

https://Asset Manager_CC_IP/api/rest/

Replace 

  • Asset Manager_CC_IP with the IP Address of your Command Center



Authentication with API Key

Each API request must include a valid API key in the header, or use basic auth.  User can generate an API key for himself or for other user as long as he has permissions to do so. Default superuser (admin) has permissions to generate key for any user. User himself has permissions to generate an API key. One can generate and enable API Key using the following method:

Generating key

CLI

The key is issued per user using the Asset Manager command-line interface command: user key new <username>

API

The key can be generated via API command:

GET /api/rest/management/user/{username}/apikey?create=true

Enabling key

CLI:

The key can be enabled by executing the command: user key enable username


API:

GET /api/rest/management/user/{username}/apikey?enable=true



Example of getting an API key for a specific user:

curl https://username:password@Asset Manager_CC_IP/api/rest/management/user/username/apikey?create=trueReplace


Replace:

  • username:password with the user name and password of the user for basic authorization
  • Asset Manager_CC_IP with the IP Address of your Command Center
  • username with the user name of the user for which you are requesting the API Key,

Please save the key in a safe location so that you can use this key for subsequent API calls.


Example of enabling an API key for a specific user:

curl https://username:password@Asset Manager_CC_IP/api/rest/management/user/username/apikey?enable=true

Replace:

    • username:password with the user name and password of the user for basic authorization
    • Asset Manager_CC_IP with the IP Address of your Command Center
    • username with the user name of the user for which you are requesting the API Key

Each API request can now include the key in the header by setting Authorization to <API KEY> and its Basic value set to Bearer