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:

  • columnSet:  Use any columnset existing in Syxsense Secure to extract exactly the fields you want.  If you do not specify a column set here, Syxsense will use the default one.
  • QueryName or QueryID will pull the devices that meet that query criteria.  Use the query name as defined in the Syxsense Console.
  • GroupName: Pulls just the devices in a specified group.
  • SiteName: Pulls a specific site.
  • Search: enter any device name to pull only that devices information.

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:

  • Curl
  • Request URL
  • Server Response

Server Response data

  • At the bottom of the Response Body, you can see the count of records retrieved, the page size, and the total page count.
  • To view the second page of data change the page parameter to '2'.
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

Discovery: Integrating the Syxsense API into External ServicesDiscovery: Integrating the Syxsense API into External Services

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