Retrieving contracts
Use /api/sam/v2/contracts.json
API to retrieve
contracts.
Example HTTP conversation
- GET /api/sam/v2/contracts.json
-
{ "total":1,"rows": [ { "contract_id":"CO1","name":"Contract1","type":2,"threshold":100,"metric":{"id":9,"code_name":"INTERNAL_INSTALL"}, "computer_group":{"id":0,"name":"All Computers"},"purchase_orders":[{"purchase_number":"PO1","quantity":5000,"entitlement_start": "2021-08-03","entitlement_end":"2030-06-21"},{"purchase_number":"PO2","quantity":2,"entitlement_start":"2030-05-21","entitlement_end":"2030-06-21"}] "software_products":[{"name":"Notepad++","publisher_name":"don.h@free.fr"}]} ] }
- GET /api/sam/v2/contracts.json?columns[]=name&columns[]=contract_custom_field_1
-
{ "total":1,"rows": [ { "name":"Contract1","contract_custom_field_1":"Value of the custom field" } ] }
Note: Not all columns are displayed by default. To see the lists
of available columns, check the below topics: