Reference: Export data through the Asset REST API
To retrieve data from Asset, use an Asset view and send the data in JSON format through the Asset REST API.
Before you begin
-
These steps require Tanium Gateway to manage API tokens. For more information, see Asset requirements.
-
To create a view in Asset, you require a role with the Asset Report write permission. The predefined Asset Administrator, Asset Operator, and Asset User roles contain this permission.
-
The steps use cURL to test the API from a local machine. To follow these steps verbatim, ensure that cURL is installed and available on your Windows, Linux, or macOS machine. You can also use your preferred API tool to access the API.
-
These steps require you to create a new Asset API user in Tanium Console. Ensure the user account exists in your IdP. For more information, see Tanium Console User Guide: User authentication.
Create a dedicated ServiceNow view
Create a view to filter endpoint data in Asset so that you only export attributes that you want.
Create a user account with the Asset API User role
Create a specific Asset API User account for which to retrieve data through the Asset API.
- From the Main menu, go to and click New User.
- Specify a User Name that matches an account in your IdP.
- Set the Display Name to Asset API User.
- In the Roles section, click Manage Roles.
- Select the Asset Report Reader and Gateway User roles, then click Apply.
- Click Save.
For more information about how to create user accounts in Tanium Console, see Tanium Console User Guide: Create a user.
Verify permissions and create an API token
Sign in to Tanium Console with the new user account to verify that you can see views in Asset and generate API tokens.
Retrieve data
Retrieve data through the Asset API integration independent of any third-party applications or partner connections. The following steps use cURL to test the API integration from Windows, Linux, and macOS machines.
Large gaps in asset IDs might result in a 500 error and the meta section might still indicate more results and data is null. For example:
{"meta":{"nextAssetId":244,"message":{"code":"asset-additional-results-may-exist-1","text":"Additional results may exist. Try again with a larger minimumAssetId."},"endOfReader":false},"data":[]}
This can occur when the view uses filters to exclude endpoints that have no data for a specific column. If you encounter a 500 error, check to see if the response contains a meta section. If the meta section appears and endOfReader is false, try the request again with a larger minimumAssetId value.