- 13 Sep 2023
- 2 Minutes to read
Axonius REST API and Python API Client
- Updated on 13 Sep 2023
- 2 Minutes to read
Axonius provides two ways to access the Axonius API:
- A RESTful API service
- A Python-wrapped API client that allows you to use the Python programming language to run REST API commands. See here for more information on installing and using the API client.
To use either API, you must have the following:
- API Key and API Secret
- API Access permission: The user's role used to access the API requires that the API Access permission will be enabled.
Creating a Service Account
You can also create Service Accounts that only connect to the system using the API. The API Key and API Secret are found in the same place for Service accounts as any other user account. See Get an API Key below.
Refer to Managing Service Accounts.
Get an API Key
Using the Axonius API to query Axonius assets requires a user name and password, or an API key and API secret.
To get an API Key and an API Secret do as follows:
Open your user Account Settings.
From the left navigation panel, under your account avatar and user name, click the Settings icon.
Select the API Key tab. Copy the existing API key and secret. To reset them, click Reset Key.
Which Headers to Use for the REST API
When sending an API request using the REST API, the API key and API secret and other information must be provided as Headers. In Postman, you enter these values in the Headers tab.
To enter the API Key and API Secret into Postman headers:
- On the Headers tab, click in the Key field of the last row and enter the text api-key. As soon as you enter a value in this row, a new empty row is added below the current row.
- In the Value field enter the API Key obtained using the instructions above.
- In the next row, in the Key field enter api-secret.
- In the Value field enter the API Secret obtained using the instructions above.
You also must define the content type.
To specify the content type:
- On the Headers tab, in the empty Key and Value fields under api-secret, enter the following:
- In the Key field enter Content-Type.
- In the Value field enter application/vnd.api+json.
Enable API Access Permission
Using the Axonius API to query Axonius assets requires a that the user's role will have the API Access enabled permission enabled.
To set this permission:
Open the Manage Roles page.
From the top right corner of all pages, click . The System Settings page opens. Then, click the Manage Roles tab.
Select the relevant role as described in Manage Roles. For the selected role, under the API Access category, select the API access enabled checkbox.