API Keys
This API has been built for ease of use and functionality. To that end, setting up authentication to the API and making calls to the API are all simple processes. What follows is a full guide for setting up access to the API and generating calls to the API.
Important Information For a full list of available API commands and API documentation, click here. |
Prerequisites A user with Admin rights A generated API Access Token |
Guided walk-through: How to Set Up the API TokenGuided walk-through: How to Set Up the API Token
First, to access the API, the currently logged-in Absolute user will need to have full administrator credentials to the console. Once the user has been granted the full administrator role within the console, the account will be eligible for API access. Next, the user will need to have an API Access Token generated.
❶ | Click the Settings gear icon in the lower-right corner of the console > Select 'API Keys' |
❷ |
The console will show the current API access tokens associated with the current user account, along with an option to create a new API token. Select the 'NewToken' button from this screen. |
❸ |
From the corresponding New API Token window, create a name for the API token, set an Expiration date, add an optional IP Address lock, and select the required level of Console Access needed for this API Token (See Roles and Scopes for more information on permissions). Depending on the level of access provided to this token, different commands will be available for execution within the API. |
❹ |
Once the desired level of access has been ascribed to this API Token, click the 'Save' button in the upper left-hand corner of the permissions panel. The API Token may take a few moments to generate. Once the token has been generated, a new screen will prompt briefly, allowing the API Token key to be recorded. This key will never be displayed in the console again, and if the key is lost, a new token must be generated. |
❺ |
After recording the Token key, close the prompt and return to the API Access page. The new token will show up in the list of currently active API tokens, as shown below. |
Guided walk-through: How to Test your APIGuided walk-through: How to Test your API
API allows to access the console data using custom scripts without the necessity to log into the Absolute Console.
You may use this feature to create custom reports with the parameters c, not predefined in Absolute reports, by retrieving the necessary data and inserting it into the Microsoft Power BI.
You can also use API to add custom fields to the various devices inventory in the console in minutes by running custom scripts.
❶ | Open Syxsense API in a browser window |
❷ |
Click 'Authorize' in the upper right > Enter your key in the value field You can generate the Bearer apiKey by selecting 'API tokens' in the 'Setting' |
❸ | Scroll down to Computers Section. |
❹ | Click 'Get' |
❺ | Click 'Try it Out' |
❻ |
Scroll down, you will see the possible parameters for the API. This section automatically updates with all the new API parameters as we add them. Examples to start with:
|
❼ |
Click the 'Execute' button, if you have not entered any criteria this will pull down all the devices from your computers table in a paged format, one page of 100 devices at a time (controlled by Page and pageSize parameters). |
❽ |
After loading you will see:
|
❾ |
Server Response data
|
❿ | You may now modify the parameters to bring customized datasets from the API. |
⓫ | The Curl and Request URL are automatically updated with the appropriate parameter strings, and can be copied to your clipboard with the icon and passed to your program of choice. |
Guided walk-through: How to Create API CallsGuided walk-through: How to Create API Calls
Before custom calls can be rendered, the API site needs to be authorized using the API Token key generated during the Token creation process.
❶ |
To authorize the API site for calls made from the correct Absolute Console and with the correct permissions, select the Authorize button within the API website. |
❷ | From the authorization menu, paste in the Token key and then click authorize. |
❸ |
Once authorized, the API site will allow calls to be made to and from the renderer. An authorized API token is shown below. Once the authorization has been verified, close the window. |
❹ |
Now that the API has been authorized, feel free to try out any of the available API calls listed in the API configuration tool. Each API call can be modified to include parameters related to queries that have been generated within the Absolute Console. This will allow for targeted calls to specific sections of the environment managed by Absolute. |
❺ |
Clicking the Try it out button will provide an output in curl format, along with an optional rendering of what the results would look like if the API were called directly in the current Absolute Console. Simply hit the execute button to see the results of the API call displayed in JSON format along with the curl command syntax which generated the API call. |
Using the API Token Key and the corresponding API from the above instructions, creating custom API calls is a relatively simple process. We generate all our API calls from the renderer using the curl utility, but it is a simple process to translate these API calls to other services.
Below is an example of the API Call generated from Ruby.
require 'net/http' require 'uri' uri = URI.parse("https://api.syxsense.io/api/Computers?") request = Net::HTTP::Get.new(uri) request["Accept"] = "*/*" request["Authorization"] = "Redacted" req_options = { use_ssl: uri.scheme == "https", } response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http| http.request(request) end puts response.body |