Retrieval of software instances (deprecated)

You use the GET operation on the api/sam/software_instances element to request information about software installed in your infrastructure.

Important: This REST API is planned to be entirely substituted with api/sam/v2/software_instances REST API. If you have custom tools or internal processes that are based on api/sam/software_instances REST API, it is best to adjust the tools to use the new version of the API. For information, see: Mapping columns between software_instances and v2/software_instances REST API.
  • To use this API, you must be assigned to the All Computers group and have the View Endpoints permission.
  • By default, the retrieved data is sorted by id.

Resource URL

To retrieve information about software instances installed on your computer systems, use the following URL:

Resource information

Table 1. Resource information
Operation details Description
Purpose Returns a list of software.
HTTP method GET
Resource URI https://server_host_name:port_number/api/sam/software_instances
URI query parameters For a list of applicable query parameters, see: Query parameters.
Request headers
Accept-Language (optional)
  • Use: Used to negotiate the language of the response. If this header is not specified, the content is returned in the server language.
  • Values: en-US (only English is supported)
  • Use: Used to authenticate REST API requests. The header is required when you set the value of the api_token_in_url_enabled parameter to false. Otherwise, you can specify the token in the request header or in the URL. For more information, see: Authenticating REST API requests.
  • Values: an alphanumeric string that is generated in License Metric Tool
Request payload n/a
Request Content-Type
  • application/json
Response headers
  • Use: Specifies the content type of the response.
  • Values: application/json
  • Use: Specifies the language of the response content. If this header is not specified, the content is returned in the server language.
  • Values: en-US, …
  • Use: Specifies the data import status.
  • Values: none, idle, running, pending
  • Use: Specifies the percentage progress of a data import.
  • Values: A percentage value, for example 59.
  • Specifies the status of the last data import.
  • successful, failed
  • Use: Specifies the time of the last successful data import.
  • Values: Date, for example 2014-06-18T04:00:29Z.
Response payload Software Instances element
Response Content-Type
  • application/json
Normal HTTP response codes
  • 200 – OK
Error HTTP response codes
  • 500 – “Bad Request” if a query parameter contains errors or is missing

Message body includes an error message with details.

Query parameters

You can use query parameters to narrow down the results of your search. The following table presents query parameters that you can use for the api/sam/software_instances element.
Table 2. Query parameters for retrieving software products
Parameter Description Required Value
columns[] Specify which columns to retrieve. If you do not specify this parameter, a set of default columns is retrieved. Example:
Retrieve the name and version columns:
No 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 computer system ID descending:
URL?order[]=computer_system_id desc
No String
limit Specify the number of rows to retrieve. If you omit this parameter, all rows are retrieved. No 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:
No Numeric
criteria Retrieve records which match specific conditions. The parameter should have the following structure, written on 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-numver> | <json-null>

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

Example: Retrieve software instances whose publisher name contains "IBM" OR the last seen date within a specific date range:
URL?criteria={ "or": [ ["publisher_name", "contains", "IBM"], 
{ "and": [ ["last_seen", ">", "1970-01-01T00:00:00+00:00Z"], 
["last_seen", "<", "1970-01-02T00:00:00+00:00Z"] ] } ] }
For columns that use the date and time values, such as Last Seen, you can retrieve data also for a period instead of a specific date. To do so, use last or next as <operator>, and then specify the time value in the following convention: PxD/PxW/PxM/PxY, where x is a number in the 1-999 range, and D, W, M, or Y is a designator that represents days, weeks, months, or years respectively. For example, to retrieve software instances that reported within last 7 days, use the following API request:

Example HTTP conversation

GET https://server_host_name:port_number/api/sam/software_instances
Request header
Accept: application/json 
Accept-Language: en-US
Token: <token>
Response header
HTTP/1.1 200 OK
Content-Type: application/json
Content-Language: en-US
The above response header may be followed by different entries, depending on the current status of the data import which is represented by Import-Mode. To understand the returned values, see the following definitions:
  • none - a data import has never been initiated
  • idle - no data imports are currently running
  • running - a data import is in progress
  • pending - an action performed in the user interface requires a data import to be started for the change to take effect
If a data import has never been initiated:
Import-Mode: none
If a data import is in progress:
Import-Mode: running
Import-Progress: 41
If a data import is not running:
Import-Mode: idle/pending
Import-Last-Status: successful
Import-Last-Success-Time: Mon, 23 Jun 2014 12:18:29 GMT
Response body (JSON)
If a particular entry is hidden by default, it is not retrieved by using the general URL. To retrieve such data, you must use query parameters to specify the name of the hidden column. For example, you can retrieve the computer_id and software_title_name columns by using the columns[] parameter:
“id”: 123,	
“software_fact_id”: 123,//hidden by default
"computer_system_id": 3,
"computer_id": 3,//hidden by default
"discoverable_guid": "0768fb15-383c-4124-a7e2-0d76dda06874",
"default_product_guid": "78d380e0-9fb9-11e3-a151-005056872dc7",//hidden by default
"first_used": null,
"last_used": null,
"valid_from": "2014-04-02T14:24:04Z",
"valid_to": "9999-12-31T23:59:59Z",
"updated_at": "2014-04-02T14:24:04Z",
"signature_count": 1,
"total_time": 0,
"total_runs": 0,
"avg_run_time": null,
"avg_runs_per_day": null,
"process": null,
"deleted": false,//hidden by default
"catalog_dimension":  //hidden by default
   "software_title_name": "BigFix Platform Agent",
   "publisher_name": "IBM",
   "software_title_version_name": "BigFix Platform Agent",
   "software_title_release_name": "BigFix Platform Agent",
   "version": "9.0"