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.
-
To create a view in Asset, you require a role with the Asset Report write permission. The predefined 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 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.
-
From the Main menu, go to .
-
If the ServiceNow (reserved) view does not appear in the grid, click Create Views, and select Create ServiceNow View.
Asset creates the ServiceNow (reserved) view and updates the grid on the Views page.
-
In the row of the ServiceNow (reserved) view, click Create Copy
.
The Create View page loads with data prefilled from the ServiceNow (reserved) view.
-
Update the name of the view. For example, ServiceNow SGC.
-
In the Select Columns from Asset Tables section, select the columns that you want to include in the view. These example steps include the Computer Name and OS Platform columns.
-
Add any filters as desired.
Note: Available filters depend on which columns you add to the view. For example, if you include the column, the SIU Product Usage Filter section appears. You can then add a filter in the SIU Product Usage Filter section to remove assets whose SIU product usage is not installed. To do so, select the Usage attribute, set the operator to does not contain, enter a value of not installed, and then click Apply.
-
Click Submit to save the view.
Asset saves the view and loads the Views page.
-
Test the view. On the Views page, hover over a view and click Test View
, which runs the view for a single asset. The resulting message states whether the view can run successfully or contains errors such as pending attributes.
-
Record the ID of the new view.
-
From the grid on the Views page, click Edit
in the row of the new view.
-
In the URL field of your browser, record the number that appears at the end of the URL.
-
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 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.
-
Sign in to Console as Asset API User.
-
From the Main menu, go to .
If you cannot access the page, verify the Asset API User role has the Asset Report Reader role.
-
Verify that you can see the view you created.
If the view does not appear, sign in to Console as a user with the Asset Report Reader permission, create the view as described in Create a dedicated ServiceNow view, and then try this step again.
-
Generate an API token for use by the Asset API User. You require a single API token per ServiceNow environment for each integration.
Note: Do not use a single token to establish sessions for multiple processes. When a token rotates for any process, that token stops working for any other processes that use the token. If you have three different environments for which you need to configure the Service Graph Connector, you can reuse the Asset API User account, but you need to create three API tokens, one for each environment.-
From the Main menu, go to and click New API Token.
-
Enter Service Graph Connector or similar message for Notes and then specify an expiration time.
-
Leave Persona set to Default.
-
Enter the external IP addresses of the systems from which you will use this token to authenticate with Tanium Cloud.
-
Click Save.
The View API Token dialog appears.
-
Click Copy API Token
to copy the token string to your clipboard, and then click Close to return to the API Tokens page.
For more information about how to create API tokens, see Managing 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.
-
On a Windows machine, open an administrator command prompt. On Linux or macOS machines, open a Terminal window.
-
Run the following command to set a variable for Tanium Cloud, where
<YourInstanceName>is the domain name or IP address of Tanium Cloud.-
Windows:
CODEset TS=<YourInstanceName>-api.cloud.tanium.com -
Linux / macOS:
CODEexport TS=<YourInstanceName>-api.cloud.tanium.com
-
-
Run the following command to set the session token, where
<YourApiToken>is the API token string that you copied to your clipboard.-
Windows:
CODEset S=<YourApiToken> -
Linux / macOS:
CODEexport S=<YourApiToken>
Tip: Include the entire token string, including thetoken-prefix. For example,set S=token-744b6a6e9408c8fec82871c80ce0d8ec6d40c7c63b04d42325c4aea824. -
-
Run the following command to verify that you have the correct ID for the view that you created. Replace the ID at the end of the URL with the ID that you recorded.
-
Windows:
CODEcurl -k -X GET -4 -H "tanium_server: %TS%" -H "Content-Type: application/json" -H "session: %S%" "https://%TS%/plugin/products/asset/v1/views/2" -
Linux / macOS:
JSONcurl -k -X GET -4 -H "tanium_server: ${TS}" -H "Content-Type: application/json" -H "session: $S" "https://${TS}/plugin/products/asset/v1/views/2"
A successful response contains the definition of the view in JSON format:
JSON{ "data":{ "definition":{ "attributes":[ { "id":1, "entityId":1, "entityName":"Computer Name", "tableName":"ci_item", "displayName":"Computer Name", "fieldName":"computer_name", "dataType":"text" }, { "id":3, "entityId":3, "entityName":"OS Platform", "tableName":"ci_item", "displayName":"OS Platform", "fieldName":"os_platform", "dataType":"text" } ], "filter":{ "$or":[ ] } }, "id":2, "viewName":"ServiceNow SGC", "description":"Reserved ServiceNow View; default view used by new ServiceNow destinations", "reserved":false, "username":"tanium", "createdAt":"2025-05-23T15:33:28.212Z", "updatedAt":"2025-05-23T15:33:28.212Z", "status":"ready" } } -
-
Run the following command to retrieve and validate data from 100 endpoints. Replace the ID associated with the
viewIdwith the ID of your ServiceNow SCG view.-
Windows:
CODEcurl -k -X GET -4 -H "tanium_server: %TS%" -H 'Content-Type: application/json' -H "session: %S%" "https://%TS%/plugin/products/asset/v1/assets?viewId=2&minimumAssetId=1&limit=100" -
Linux / macOS:
JSONcurl -k -X GET -4 -H "tanium_server: ${TS}" -H 'Content-Type: application/json' -H "session: $S" "https://${TS}/plugin/products/asset/v1/assets?viewId=2&minimumAssetId=1&limit=100"
A successful response contains details for up to 100 endpoints in JSON format. truncated example:
JSON{ "meta":{ "nextAssetId":101, "endOfReader":false }, "data":[ { "computer_name":"test001", "os_platform":"AIX" }, { "computer_name":"test002", "os_platform":"Linux" }, { "computer_name":"test003", "os_platform":"Windows" } ] }The response includes two metadata properties to help paginate the data:
-
nextAssetId: The ID of the next asset to retrieve. In terms of pagination, use this value as the cursor to start the next page of data. WhenendOfReaderisfalse, the nextAssetId field is omitted from the response. -
endOfReader: A value offalseindicates that more endpoint data is available. To retrieve all endpoint data, paginate until you reach the end of the results, indicated whenendOfReaderistrue.
The
nextAssetIdandendOfReaderproperties appear in themetasection at the beginning of the response. For example:JSON{"meta":{"nextAssetId":101,"endOfReader":false},"data":[{... -
-
Continue to run the GET command. In each command, set the
minimumAssetIdparameter to the value of thenextAssetIdproperty that was returned in the previous response.-
Windows:
CODEcurl -k -X GET -4 -H "tanium_server: %TS%" -H 'Content-Type: application/json' -H "session: %S%" "https://%TS%/plugin/products/asset/v1/assets?viewId=2&minimumAssetId=101&limit=100" -
Linux / macOS:
JSONcurl -k -X GET -4 -H "tanium_server: ${TS}" -H 'Content-Type: application/json' -H "session: $S" "https://${TS}/plugin/products/asset/v1/assets?viewId=2&minimumAssetId=101&limit=100"
When a response includes
endOfReader: trueand omits thenextAssetIdproperty, there are no more assets to retrieve. -
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.