Syxsense API
• 5 min to read •
As part of Syxsense Enterprise, we provide access to pull or push information to and from the Syxsense Console. 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 |
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 Syxsense 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.
❶ |
Start by clicking on their user icon in the upper right-hand corner of the Syxsense Console.Drop-down TitleDrop-down Title |
❷ |
Then, select the link for 'API Access Tokens (PREVIEW)'.Drop-down TitleDrop-down Title |
❸ |
Once the API Access Tokens link has been activated, the Console will show a new screen with all the current API access tokens associated with the current user account, along with an option to create a new API token. Select the New Token button from this screen. Drop-down TitleDrop-down Title |
❹ |
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. For this example, we have selected just the Devices context.
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, hit 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. Drop-down TitleDrop-down Title |
❺ |
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.Drop-down TitleDrop-down Title |
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 Syxsense Console.
You may use this feature to create custom reports with the parameters c, not predefined in Syxsense 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 Syxsense console in minutes by running custom scripts.
❶ | Open Syxsense API in a browser window |
❷ |
Click in the upper right > Enter your key in the value field You can generate the Bearer apiKey by selecting in the 'Setting' Drop-down TitleDrop-down Title |
❸ | Scroll down to Computers Section. Drop-down TitleDrop-down Title |
❹ | 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 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 Syxsense Console and with the correct permissions, select the Authorize button within the API website.Drop-down TitleDrop-down Title |
❷ | From the authorization menu, paste in the Token key and then click authorize. Drop-down TitleDrop-down Title |
❸ |
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.Drop-down TitleDrop-down Title |
❹ |
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 Syxsense Console. This will allow for targeted calls to specific sections of the environment managed by Syxsense.Drop-down TitleDrop-down Title |
❺ |
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 Syxsense 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.Drop-down TitleDrop-down Title |
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 a Syxsense 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 |
Last Update: Mar 12, 2024
Copyright ©2024 by Syxsense, Inc. All Rights Reserved