REST API

The built-in REST API interface provides you with a way to visualize RESTful web services. The API documentation is built using Swagger, where you can test API operations and instantly view the results to help you scan your applications faster.

About this task

Learn how to use the interactive framework by following this example to import an application inventory by using the /api/v4/Apps/ImportFile REST API.

Procedure

  1. Select Tools > API.
  2. Click the Swagger link on the right side of the page. You are automatically logged in to Swagger.
  3. Create an asset group:
    1. Expand the Asset Groups API and click POST /api/v4/AssetGroups.
    2. Replace the "string" parameters with a name and description for the asset group. Keep the quotation marks. Creating an Asset Group API
    3. Click Execute.
    4. Make note of the ID in the Response Body section; you'll need to use that ID in the next API.
      Copy ID from response body
  4. Import an application inventory file:
    1. Expand the Applications API and click POST /api/v4/Apps/ImportFile.
      In the Implementation section, there is a sample file that you can download to get a sense of the types of attributes to include in your file.
    2. Enter the assetGroupId from step 3d in the Value field of the Parameters section.
    3. Click Browse in the uploadedFile section to locate your CSV file of applications to import.
    4. Click Execute.
      A successful import appears as follows:Successful application import