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/v2/Apps/ImportFile REST API.
Procedure
-
Select .
-
Click the Swagger link on the right side of the page.
You are automatically logged in to Swagger.
-
Create an asset group:
-
Expand the Asset Groups API and click
POST /api/v2/AssetGroups.
-
In the Parameters section, click the text in
the Example Value edit box to copy the text as a
JSON object request to the IBMIdModel box.
-
Replace the
"string"
parameters with a name and
description for the asset group. Keep the quotation marks.
-
Click Try it out!.
-
Make note of the ID in the Response Body
section.
You'll need to use that ID in the next API.
-
Import an application inventory file:
-
Expand the Applications API and click
POST /api/V2/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.
-
Enter the assetGroupId from step 3d in the
Value field of the
Parameters section.
-
Click Browse in the
fileToUpload section to locate your CSV file of
applications to import.
-
Click Try it out!.
-
In the Response Headers section, copy the ID
from the
"Location"
line.
-
Expand the POST /api/v2/Apps/ImportJobs/{jobId}
API.
-
Enter the ID into the jobID field.
-
Click Try it out!.
Results
A successful import looks something like this: