Retrieval of software components (v2)

9.2.14 Available from 9.2.14. You use the GET operation on the api/sam/v2/software_components element to request information about software components in your catalog. The API returns details of existing components as well as historical data about components that were removed.

Permissions

An icon representing a user. You must have the View Software Catalog and Signatures permission to perform this task.

Resource URL

https://hostname:port/api/sam/v2/software_components?token=token

Resource information

Table 1. Resource information

Operation details Description
HTTP method GET
Request headers
Header
Accept-Language (optional)
Values
en-US (only English is supported)

Negotiates the language of the response. If the header is not specified, the content is returned in the server language.

Request format application/json
Response headers
Header
Content-Type
Values
application/json

Specifies the content type of the response.

Header
Content-Language
Values
en-US, …

Specifies the language of the response content. If the header is not specified, the content is returned in the server language.

Response payload Software Components element
Response format application/json
Response codes

200 – OK

500 – "Bad Request" if a query parameter contains errors or is missing

Schema description

To retrieve the list of all columns that are returned by this REST API together with their descriptions, use the following request.
GET api/sam/v2/schemas/software_component.json?token=<token>

Available columns

Table 2. Available columns

The table consists of three columns and 26 rows.

Column Description Displayed by default Type
id Identifier of the component instance. Numeric
name Name of the component. String
release Release of the component. String
guid Component GUID. String
is_BigFix Information whether the component is provided by BigFix. Boolean

Applicable associations

You can additionally retrieve data from the following associations:

Query parameters

Table 3. Query parameters

The table consists of four columns and six rows.

Parameter Description Required Value
columns[] Specify which columns to retrieve. If you do not specify this parameter, only default columns are retrieved.
Example: Retrieve component name and id
URL?columns[]=name&columns[]=id
String
order Specify how to sort the returned data. The default direction for sorting columns is ascending. If you want to specify a descending sort, append desc to the column name.
Example: Order by component ID descending
URL?order[]=id desc
Alphanumeric
limit Specify the number of rows to retrieve. If you omit this parameter, all rows are retrieved.
Example: Retrieve 100 records
URL?limit=100
Numeric
offset Specify the number of rows to skip for retrieving results. You can use it together with the limit parameter to paginate results.
Example: Retrieve 50 records starting after record 150
URL?limit=50&offset=150
Numeric
token A unique user authentication identifier. You can retrieve it by using REST API for retrieving authentication token. You can also log in to BigFix Inventory, hover over the User icon User icon, and click Profile. Then, click Show token. Alphanumeric
criteria Retrieve records which match specific conditions. The parameter should have the following structure, written in one line:
<criteria> ::= <left-brace> <boolean-operator> <colon> <left-bracket> 
<criterion> [{ <comma> <criterion> }...] <right-bracket> <right-brace>
<boolean-operator> ::= "and" | "or"
<criterion> ::= <criteria> | <left-bracket> <column> <comma> <operator> <comma> <value> <right-bracket>
<column> ::= <json-string>
<operator> ::= <json-string>
<value> ::= <json-array> | <json-string> | <json-number> | <json-null>

For more information about operators, see: Common connectors and operators.

String

Example conversation - default columns

Request
GET api/sam/v2/software_components?token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623
Host: localhost:9081 
Accept: application/json 
Accept-Language: en-US
Response body
[{
"id":1,
"name":"DB2 8.1",
"release":8,
"guid":"XYZ",
"is_ibm":1,
}]

Example conversation - association

Request
GET api/sam/v2/software_components?columns[]=id&columns[]=name
&columns[]=tags.name
&token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623
Host: localhost:9081 
Accept: application/json 
Accept-Language: en-US
Response body
[{
"id":1,
"name":"DB2 8.1",
"tags":
[{"name":"ibm"}]
}]