Download OpenAPI specification:Download
The Sassafras REST API provides programmatic access to settings and objects on Sassafras AllSight, LabSight, and KeySight servers.
This document provides information on the REST methods and resources for version 2 of the API. The API should be used for basic querying of the data, and not for bulk or heavy-use data retrieval. There are currently other more efficient mechanisms for processes that require full data capture or continual bulk data access.
The easiest way to test the API is to use a program like curl, although for GET-based methods a browser will be sufficient. Tools like Postman are useful for more advanced API testing.
All REST APIs are intended to provide access to resources using predictable and consistent URIs. Clients of a REST API submit HTTP requests and receive the results of the request in well-defined formats. Each request operates on the specified resource according to the request's HTTP method, which can be one of GET, PUT, POST, PATCH, and DELETE. A REST API request URI follows the pattern:
https://server.sample.net/api/v2/resource-path?arguments
The resource-path gives the path to a unique resource. Requests can be made on resources at each level of the hierarchy, and the response will list the resources contained at that level. For example, a request made for the URI:
https://server.sample.net/api/v2
would return the resources available within version 2 of the API. When a request is made for a resource that is not a container, the response has just the single resource.
The arguments in the URI can supply:
Response fields and query filters are covered below.
When POSTing data, the commonly accepted format is JSON, although certain endpoints expect plain text or raw data. Requests should include a Content-Type header that indicates the actual format used, for example application/json for JSON formatted request bodies. With curl you can do this as follows:
curl --header "Content-Type: application/json" https://server.sample.net/api/v2/...
Responses will be formatted as JSON for most endpoints, although certain resource endpoints have different format types as appropriate. The response will always include a Content-Type header to indicate the format.
Responses with Content-Type application/json conform to a simple schema that supports individual objects and arrays of objects, where each object contains properties corresponding to the requested fields in addition to the resource ID and type.
When the response contains multiple resources, the resources are sent as members of a JSON array.
[
{ resource fields... },
{ resource fields... },
...
]
Responses with just one resource are sent without an enclosing array.
{
resource fields...
}
Response data contains the resource ID and type by default. To receive other attributes of the resource, the attribute field names are given in the fields=... argument. Field names vary depending on the resource type, but all resources have ident and type fields. The ident can be used to request resources within the containing resource.
https://server.sample.net/api/v2/computer
This query would return a response listing all the sub-resources within the computer resource:
[
{ "ident":"items", "type":"topic" },
{ "ident":"sections", "type":"topic" },
{ "ident":"divisions", "type":"topic" },
{ "ident":"schema", "type":"topic" }
]
The list in the response gives resources that we can request within the computer resource. By default, list responses like this will only return the ident and type fields. To retrieve fields other than these, include the field names in the fields argument.
For leaf resources that do not contain other resources, the response will be a single object instead of a list of objects. In the next example we also include a fields argument, with field names separated by commas. The fields are specific to the resource type, product in this case:
https://server.sample.net/api/v2/product/items/5A55ADEF383F4E8798073862A18D3433?fields=Name,Version,Publisher
When a URI includes a fields argument, those fields will be included in the resource record (the ident and type fields are always included):
{
"ident": "5A55ADEF383F4E8798073862A18D3433",
"type": "product",
"Name": "Microsoft Office 2008 for Mac Standard Edition",
"Version": "2008",
"Publisher": "Microsoft Corporation"
}
By default, a response with a single leaf resource will contain many fields other than ident and type. In this case, the fields argument can be used to reduce this default field set to just those that are required by the particular request. Furthermore, some resources have fields that are costly to gather and return. Such costly fields will only be included in the result when they are requested in the fields argument.
Valid field names for each resource type are listed in the description of each endpoint below, and also can be retrieved from the associated schema endpoints.
Endpoints that return a list of resources support a query filter that selects the set of resources that will be returned. Query filters use a typical format that includes common comparison and logical operators. Any top-level field defined for the resource type of the target endpoint can be used in the query filter. The query filter is provided in the query=... argument.
For example, a simple query filter on the computer/items endpoint can select just those computers that are in a particular division:
(Division="Some Division")
On the product/items endpoint, all products that are installed on at least 100 computers:
(InstallCount>=100)
On the report/items endpoint, the list of reports that were created more recently than a certain date:
(created>=@20220925000000Z)
Note the variations in syntax in these three examples. In the first example, since we are comparing with text string, that value is within quotation marks (it is valid to use either single or double quotation marks, as long as they are consistent). The second example is comparing a number, so there are no quotations marks around the value. The date in the third example demonstrates the required format: @YYYYMMDDhhmmssZ. Dates can be specified as UTC (suffix Z), or within a time zone (e.g., @20220925123000-0400, generally @YYYYMMDDhhmmss[+-]hhmm).
To test for non-zero or non-empty values, just use the field name:
(Anchored)
In addition to the usual comparison operators, there some useful substring operators available. In all cases the order of the operands is important: the string to be searched for on the left, the string to search on the right.
String prefix: ("needle"*=Haystack)
String suffix: ("needle"%=Haystack)
String containment: ("needle"~=Haystack)
All string comparisons and searches are case-insensitive.
More complex query filters can be built using logical operators. Use parentheses to indicate the order of operations. This query filter on the computer/items endpoint looks for all computers in the "Second Floor" division that are enabled for audits but have not audited since a certain date:
(Division='Second Floor')&&(Audited)&&(LastAudit<@20220925000000-0400)
Complex query filters can also use logical or ||
and negation !
.
The API treats all field keys in a case-insensitive way. This means if you use a field like "Name" in a request body or in a query filter, it will be the same as if you had used "name" or "NAME". The field keys that are returned in responses will match how they were specified in the request's field parameter. If you send a request with fields=name, the response will include that field with the key "name". If you do not specify the field key but the field still appears in the response (e.g., with a GET request on a non-container resource when no fields parameter is given), the field key will use a consistent case from one request to another.
Although the API treats field keys as case-insensitive on the server side, many client-side environments (like JavaScript) are case-sensitive, so you must use the proper cases when referencing fields. The best way to ensure that you get the casing you require is to use the fields parameter to explicitly request the fields you will be using. Otherwise, make a test query to the endpoint to determine what the default casing is for a particular field, and use that.
Requests to endpoints that return a list of resources are expensive for the server to process. Every resource in the list must be loaded from the data, tested, and formattted for the resulting response. If you are making frequent requests to a list endpoint you should consider using the Bulk Query endpoints or other mechanisms that are more suited to bulk data retrieval, or that incorporate caching.
See the documentation for Scripting, ksODBC, ksJDBC, and exporting.
Requests to leaf endpoints that return a single object are more efficient (unless you make many many such requests), although requesting a full object with complex sub-fields creates additional server load. It is always best to request just those fields that are actually needed and consider caching the response data.
While it is possible to get all data for all objects in one query, making such a large request can be wasteful of server resources especially if the intent is to use only part of the data. It is best to request just the fields that are necessary for the task, and use a filter to reduce the number of items returned. If the query is being used to locate just one object, perhaps by name, it is best to search for the matching object once and cache the ID, then in subsequent queries use the ID to get the object directly.
Servers can be configured to limit the number of REST API calls that can be made over some period of time. When a request would cause this limit to be exceeded, it will fail with error code 429. The Retry-After header will indicate the number of seconds to wait before making the request again. Note that this rate limit is independent of who is making the request -- the same limit is shared and used by all accounts.
In most cases (and particularly for cloud-hosted servers) the primary purposes for the rate limit are to prevent abuse and curtail brute-force attacks. If your use of the REST API is significantly constrained by the rate limit, it is possible to increase the limit. If the server is self-hosted, the configuration can be changed by any admin with sufficient privileges. If the server is cloud-hosted by Sassafras, the limit can only be raised by contacting Sassafras Software.
The Sassafras REST API uses access tokens to authenticate and authorize requests. Access tokens are passed in the Authorization header of each API request as Bearer tokens.
For development and testing, it is possible to use HTTP Basic Auth for API requests. This option is not intended for production use since the account name and password must be provided to the code that is making the requests, and there is no mechanism for limiting the priviliges beyond what the account holds.
Access tokens represent the permissions granted to the account that created them, so it is important to store and use them securely. All API requests should be made over HTTPS in order to ensure the privacy of access tokens. Keeping access tokens secure is your responsibility.
When API calls are made within a web page, authentication can use existing credentials held by the browser (provided the user has connected to and authenticated with the API host server via the Web UI).
All API requests must have an Authorization header with valid credentials. When credentials are not present or invalid a 4xx level status response will be returned. A 4xx level status will also be returned when credentials are valid but the account does not have permission for the requested endpoint or resource.
See the following section on Token Endpoints for information on creating access tokens.
You can create an access token in the Web UI by selecting View Account or Edit Account from the account menu in the upper right of any page. Click the Get Access Token button, provide the requested information, click Create, and copy the resulting access token.
Each access token represents the permissions that have been granted to the account that created it. If the permissions for the account change, the access token will adopt these changes. An access token can contain a permissions scope that places further restrictions on the account's permissions. An access token's permission scope cannot add new permissions, it can only restrict the permissions held by the account.
An access token has a limited lifetime, after which it will no longer be valid. Furthermore, any internal account's previously issued access tokens can be immediately invalidated by changing that account's password.
With existing credentials (for example, an access token created within the Web UI), new access tokens can be created to extend API access into the future, or apply additional restrictions.
Create a new access token with a set expiration
token parameters
lifetime | integer <int32> token lifetime in seconds |
scope | string |
{- "lifetime": 86400
}
{- "lifetime": 86400,
- "token": "eyJ0eXAiOiJqd3QiLC..."
}
In support of API discovery, every container endpoint supports the GET method, which returns the list of topic endpoints within that container. Use the topic lists to browse through all the endpoints that are available (provided your account has the appropriate permissions). Note that some endpoints are not documented here. These endpoints are used internally, and might change without warning. If an undocumented endpoint looks like it might be of use to you, please contact Sassafras Software to discuss your use case.
container-path required | string Examples:
relative path of the container |
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "topic",
- "ident": "computer"
}, - {
- "type": "topic",
- "ident": "product"
}
]
Computer records are created for all computers that have the KeyAccess client software installed. Computer records can also be created by importing information from other sources such as Intune and Jamf, or by creating them with scripts or API calls. Computer IDs can be based on a MAC address, hardware serial number, computer name, or other quasi-unique system properties. The client determines the ID of a computer by stepping through an ordered list of "ID Types", using the first ID type that has a valid value for that computer's ID. Computer records that are imported or otherwise created without a client can use whichever ID makes the most sense. If the source data has the serial number of a computer, that is the recommended choice for the ID.
Computer records are not just created for physical hardware. For licensing purposes a computer record is also created for Thin-client connections so an RDP server that has the client installed. Computer records are also create for virtual computer instances that have the client installed.
While it is possible to delete Computer records, it is often best to leave them in the data and use the Login type or Lifecycle Stage to mark them as uninteresting. If the computer has the client software installed, the matching computer record will be recreated the next time the client on that computer communicates with the server. Deleting a computer record also removes some of the data that was collected for that computer, and removes that computer from various usage reporting. Such historical data might prove useful even once the computer has been removed from service.
Retrieve a list of all computers that match an optional filter provided in the query parameter.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "computer",
- "ident": "B2359823495"
}, - {
- "type": "computer",
- "ident": "B9038590431"
}
]
Create a new computer
computer to create
ident | string unique ID of the object |
type | string type of this object |
Name | string |
Array of objects (ComputerDeviceList) | |
Array of objects (DocumentList) | |
... | any see /api/v2/computer/schema/items for full list of properties |
{- "ident": "B2359823495",
- "name": "SFCN-OPS-8563"
}
Retrieve the properties of an existing computer.
computer-id required | string Example: B2359823495 ID of the computer |
fields | string Example: fields=name optional fields to include in response |
{- "type": "computer",
- "ident": "B2359823495"
}
Modify the properties of an existing computer
computer-id required | string Example: B2359823495 ID of the computer |
computer properties
ident | string unique ID of the object |
type | string type of this object |
Name | string |
Array of objects (ComputerDeviceList) | |
Array of objects (DocumentList) | |
... | any see /api/v2/computer/schema/items for full list of properties |
{- "name": "SFCN-OPS-8563"
}
Retrieve a list of all devices associated with a computer.
computer-id required | string Example: B2359823495 ID of the computer |
[- {
- "deviceid": "379F443E11094D5BBD103C06FA6B4A8D",
- "last": "2022-08-25T12:34:56.000Z"
}, - {
- "deviceid": "75992E583801C621A0124C56A23ED0E5",
- "last": "2022-08-25T12:34:56.000Z"
}
]
Associate devices with a computer.
device(s) to associate with this computer
deviceid | string |
date | string <date-time> |
{- "name": "379F443E11094D5BBD103C06FA6B4A8D",
- "last": "2022-08-25T12:34:56.000Z"
}
Remove device associations from a computer.
computer-id required | string Example: B2359823495 ID of the computer |
device associations to remove
[- "379F443E11094D5BBD103C06FA6B4A8D",
- "75992E583801C621A0124C56A23ED0E5"
]
Retrieve information about a device associated with a computer.
computer-id required | string Example: B2359823495 ID of the computer |
device-id required | string Example: 379F443E11094D5BBD103C06FA6B4A8D ID of the device |
{- "deviceid": "379F443E11094D5BBD103C06FA6B4A8D",
- "last": "2022-08-25T12:34:56.000Z"
}
Modify information about a device associated with a computer
computer-id required | string Example: B2359823495 ID of the computer |
device-id required | string Example: 379F443E11094D5BBD103C06FA6B4A8D ID of the device |
device information
deviceid | string |
date | string <date-time> |
{- "last": "2022-09-25T12:34:56.000Z"
}
Retrieve a list of all documents for a computer.
computer-id required | string Example: B2359823495 ID of the computer |
[- {
- "name": "manifest-20220925.txt",
- "date": "2022-08-25T12:34:56.000Z",
- "file": "/api/v2/computer/documents/B2359823495/manifest-20220925.txt",
- "store": "ks-store:///maid/B2359823495/manifest-20220925.txt"
}, - {
- "name": "AdvanceTech PowerTower 2000",
- "date": "2022-08-25T12:34:56.000Z",
}
]
Reference documents for a computer. Use this endpoint to reference web links for a computer. To store files on the server, use the /api/v2/computer/documents/{computer-id} endpoint, which will automatically add a reference for the document.
document(s) to reference
name | string |
date | string <date-time> |
url | string |
file | string |
store | string |
{- "name": "AdvanceTech PowerTower 2000",
}
Remove documents for a computer.
computer-id required | string Example: B2359823495 ID of the computer |
documents to remove
[- "manifest-20220925.txt",
- "AdvanceTech PowerTower 2000"
]
Retrieve the information about a document for a computer.
computer-id required | string Example: B2359823495 ID of the computer |
document-id required | string Example: invoice-634259.pdf ID of the document |
{- "name": "manifest-20220925.txt",
- "date": "2022-08-25T12:34:56.000Z",
- "file": "/api/v2/computer/documents/B2359823495/manifest-20220925.txt",
- "store": "ks-store:///maid/B2359823495/manifest-20220925.txt"
}
Modify the information about a document for a computer
computer-id required | string Example: B2359823495 ID of the computer |
document-id required | string Example: invoice-634259.pdf ID of the document |
document information
name | string |
date | string <date-time> |
url | string |
file | string |
store | string |
{- "date": "2022-09-25T12:34:56.000Z"
}
Retrieve a list of all documents saved for a computer.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "document",
- "ident": "invoice-634259.pdf",
- "name": "invoice-634259.pdf",
- "size": 12112,
- "date": "2022-09-25T21:27:32"
}, - {
- "type": "document",
- "ident": "manifest-20220925.txt",
- "name": "manifest-20220925.txt",
- "size": 3785,
- "date": "2022-09-25T15:58:03"
}
]
Remove an existing document. Any reference to the document will be removed from the computer record.
computer-id required | string Example: B2359823495 ID of the computer |
document-id required | string Example: invoice-634259.pdf ID of the document |
Device records are created for certain devices discovered by the KeyAccess client on a computer. Device records can also be created by importing information from other sources such as Intune and Jamf, or by creating them with scripts or API calls. Device IDs are derived from a device's unique serial number.
Retrieve a list of all devices that match an optional filter provided in the query parameter.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "device",
- "ident": "379F443E11094D5BBD103C06FA6B4A8D"
}, - {
- "type": "device",
- "ident": "75992E583801C621A0124C56A23ED0E5"
}
]
Create a new device
device to create
ident | string unique ID of the object |
type | string type of this object |
Name | string |
Array of objects (DocumentList) | |
... | any see /api/v2/device/schema/items for full list of properties |
{- "ident": "75992E583801C621A0124C56A23ED0E5",
- "name": "DELL UP3214Q"
}
Retrieve the properties of an existing device.
device-id required | string Example: 379F443E11094D5BBD103C06FA6B4A8D ID of the device |
fields | string Example: fields=name optional fields to include in response |
{- "type": "device",
- "ident": "75992E583801C621A0124C56A23ED0E5"
}
Modify the properties of an existing device
device-id required | string Example: 379F443E11094D5BBD103C06FA6B4A8D ID of the device |
device properties
ident | string unique ID of the object |
type | string type of this object |
Name | string |
Array of objects (DocumentList) | |
... | any see /api/v2/device/schema/items for full list of properties |
{- "name": "DELL UP3214Q"
}
Retrieve a list of all documents for a device.
device-id required | string Example: 379F443E11094D5BBD103C06FA6B4A8D ID of the device |
[- {
- "name": "manifest-20220925.txt",
- "date": "2022-08-25T12:34:56.000Z",
- "file": "/api/v2/device/documents/B2359823495/manifest-20220925.txt",
- "store": "ks-store:///papr/B2359823495/manifest-20220925.txt"
}, - {
- "name": "AdvanceTech PowerTower 2000",
- "date": "2022-08-25T12:34:56.000Z",
}
]
Reference documents for a device. Use this endpoint to reference web links for a device. To store files on the server, use the /api/v2/device/documents/{device-id} endpoint, which will automatically add a reference for the document.
document(s) to reference
name | string |
date | string <date-time> |
url | string |
file | string |
store | string |
{- "name": "AdvanceTech PowerTower 2000",
}
Remove documents for a device.
device-id required | string Example: 379F443E11094D5BBD103C06FA6B4A8D ID of the device |
documents to remove
[- "manifest-20220925.txt",
- "AdvanceTech PowerTower 2000"
]
Retrieve the information about a document for a device.
device-id required | string Example: 379F443E11094D5BBD103C06FA6B4A8D ID of the device |
document-id required | string Example: invoice-634259.pdf ID of the document |
{- "name": "manifest-20220925.txt",
- "date": "2022-08-25T12:34:56.000Z",
- "file": "/api/v2/device/documents/B2359823495/manifest-20220925.txt",
- "store": "ks-store:///papr/B2359823495/manifest-20220925.txt"
}
Modify the information about a document for a device
device-id required | string Example: 379F443E11094D5BBD103C06FA6B4A8D ID of the device |
document-id required | string Example: invoice-634259.pdf ID of the document |
document information
name | string |
date | string <date-time> |
url | string |
file | string |
store | string |
{- "date": "2022-09-25T12:34:56.000Z"
}
Retrieve a list of all documents saved for a device.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "document",
- "ident": "invoice-634259.pdf",
- "name": "invoice-634259.pdf",
- "size": 12112,
- "date": "2022-09-25T21:27:32"
}, - {
- "type": "document",
- "ident": "manifest-20220925.txt",
- "name": "manifest-20220925.txt",
- "size": 3785,
- "date": "2022-09-25T15:58:03"
}
]
Remove an existing document. Any reference to the document will be removed from the device record.
device-id required | string Example: 379F443E11094D5BBD103C06FA6B4A8D ID of the device |
document-id required | string Example: invoice-634259.pdf ID of the document |
Products are the primary object for recording software usage and gathering software audits. Products typically contain one or more executable programs, which are tracked by the client software when gathering usage data. Web Products reference URLs instead of executable programs for tracking browser activity. Products can also contain information for fonts as a way to audit where fonts are installed. Finally, a set of related products can be gathered into a family product for use in aggregating usage and audit information.
Products are automatically imported into a server based on what software has been discovered on the clients of that server. The information about these products is retrieved from Sassafras's Product Recognition Service (PRS), a collection of over 15,000 software products that is maintained and updated by Sassafras. The core definition of products imported from PRS should not be changed, since those changes can be removed if the products are re-imported for any reason. The core definition includes the programs, packages, fonts, URLs, and editions/families that make up the product; the product Name, Version, and Publisher; various other PRS-supplied information like Description and Category. There are non-core properties that are intended for customization and can be changed without issue, such as Web Description, External URL, External ID, Notes, and Tags. Of course any manual products created specifically on a server can be defined and changed as needed and will not be altered by PRS imports.
Retrieve a list of all products that match an optional filter provided in the query parameter.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "product",
- "ident": "A31B980EAA3B4E33BD50E0C0A0824842"
}, - {
- "type": "product",
- "ident": "5A55ADEFBA2EB011E528102AF8BBED17"
}
]
Create a new product
product to create
ident | string unique ID of the object |
type | string type of this object |
Name | string |
Publisher | string |
Version | string |
Platform | string |
Category | string |
Description | string |
Address | string |
Array of objects Expensive The list of program variants in this product (for product editions) | |
Array of objects Expensive The list of packages in this product (for product editions) | |
Array of objects Expensive The list of products in this family (for product families) | |
Array of objects Expensive The list of families that contain this product (for product editions) | |
Array of objects Expensive The list of policies that cover this product | |
... | any see /api/v2/product/schema/items for full list of properties |
{- "ident": "A31B980EAA3B4E33BD50E0C0A0824842",
- "name": "Acmesoft WordWrite"
}
Retrieve the properties of an existing product.
product-id required | string Example: A31B980EAA3B4E33BD50E0C0A0824842 ID of the product |
fields | string Example: fields=name optional fields to include in response |
{- "type": "product",
- "ident": "5A55ADEFBA2EB011E528102AF8BBED17"
}
Modify the properties of an existing product
product-id required | string Example: A31B980EAA3B4E33BD50E0C0A0824842 ID of the product |
product properties
ident | string unique ID of the object |
type | string type of this object |
Name | string |
Publisher | string |
Version | string |
Platform | string |
Category | string |
Description | string |
Address | string |
Array of objects Expensive The list of program variants in this product (for product editions) | |
Array of objects Expensive The list of packages in this product (for product editions) | |
Array of objects Expensive The list of products in this family (for product families) | |
Array of objects Expensive The list of families that contain this product (for product editions) | |
Array of objects Expensive The list of policies that cover this product | |
... | any see /api/v2/product/schema/items for full list of properties |
{- "name": "Acmesoft WordWrite 1.0",
- "publisher": "Acmesoft Software"
}
Policies are used to configure how the server should record software usage and enforce license limitations. A policy can have one of three actions: Manage, Observe, or Deny. A policy also has a Scope that defines where (or to whom) the policy applies. Each policy references a list of software products that are covered by that policy, and there can be multiple policies that reference the same product.
Retrieve a list of all policies that match an optional filter provided in the query parameter.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "policy",
- "ident": "0400083B5F6A884600000000"
}, - {
- "type": "policy",
- "ident": "0400084D5FF8B22A00000000"
}
]
Create a new policy
policy to create
ident | string unique ID of the object |
type | string type of this object |
Name | string |
Section | string |
Scope | string |
Action | integer <int32> |
Metric | integer <int32> |
Maximum | integer <int32> |
Timeout | integer <int32> |
Array of objects | |
Array of objects (PolicyProduct) Expensive The list of products covered by this policy | |
Array of objects (PolicyComputer) Expensive The list of computers that are licensed (or have used) this policy | |
Array of objects (PolicyUser) Expensive The list of users who are licensed (or have used) this policy | |
... | any see /api/v2/policy/schema/items for full list of properties |
{- "ident": "0400083B5F6A884600000000",
- "name": "Acmesoft WordWrite Policy"
}
Retrieve the properties of an existing policy.
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
fields | string Example: fields=name optional fields to include in response |
{- "type": "policy",
- "ident": "0400083B5F6A884600000000"
}
Modify the properties of an existing policy
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
policy properties
ident | string unique ID of the object |
type | string type of this object |
Name | string |
Section | string |
Scope | string |
Action | integer <int32> |
Metric | integer <int32> |
Maximum | integer <int32> |
Timeout | integer <int32> |
Array of objects | |
Array of objects (PolicyProduct) Expensive The list of products covered by this policy | |
Array of objects (PolicyComputer) Expensive The list of computers that are licensed (or have used) this policy | |
Array of objects (PolicyUser) Expensive The list of users who are licensed (or have used) this policy | |
... | any see /api/v2/policy/schema/items for full list of properties |
{- "maximum": 20
}
Retrieve a list of all products that are covered by a policy.
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
[- {
- "productid": "5A55ADEFBA2EB011E528102AF8BBED17",
- "primary": true
}, - {
- "productid": "A31B980EAA3B4E33BD50E0C0A0824842"
}
]
Assign products to a policy
product(s) to add
productid | string ID of the product |
primary | boolean primary product for this policy |
{- "productid": "5A55ADEFBA2EB011E528102AF8BBED17",
- "primary": true
}
Unassign products from a policy.
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
product(s) to remove
[- "5A55ADEFBA2EB011E528102AF8BBED17",
- "A31B980EAA3B4E33BD50E0C0A0824842"
]
Retrieve status of a product covered to a policy.
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
product-id required | string Example: A31B980EAA3B4E33BD50E0C0A0824842 ID of the product |
{- "productid": "5A55ADEFBA2EB011E528102AF8BBED17",
- "primary": true
}
Modify the status of a product covered by a policy
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
product-id required | string Example: A31B980EAA3B4E33BD50E0C0A0824842 ID of the product |
product reference
productid | string ID of the product |
primary | boolean primary product for this policy |
{- "primary": true
}
Retrieve a list of all computers that are assigned to a policy.
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
[- {
- "computerid": "B2359823495",
- "expiration": "2022-09-25T12:34:56.000Z",
- "lastuse": "2022-08-26T12:34:56.000Z"
}, - {
- "computerid": "B9038590431",
- "expiration": "2022-09-20T08:30:00.000Z"
}
]
Assign computers to a policy
computer(s) to add
computerid | string ID of the computer |
count | integer <int32> |
expiration | string <date-time> ISO time when the assignment will expire |
lastuse | string <date-time> ISO time of last use |
{- "computerid": "B2359823495",
- "expiration": "2022-09-25T12:34:56.000Z"
}
Unassign computers from a policy.
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
computers to unassign
[- "B2359823495",
- "B9038590431"
]
Retrieve status of a computer assigned to a policy.
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
computer-id required | string Example: B2359823495 ID of the computer |
fields | string Example: fields=name optional fields to include in response |
{- "computerid": "B2359823495",
- "expiration": "2022-09-25T12:34:56.000Z",
- "lastuse": "2022-08-26T12:34:56.000Z"
}
Modify the status of a computer assigned to a policy
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
computer-id required | string Example: B2359823495 ID of the computer |
computer assignment status
computerid | string ID of the computer |
count | integer <int32> |
expiration | string <date-time> ISO time when the assignment will expire |
lastuse | string <date-time> ISO time of last use |
{- "expiration": "2022-09-25T12:34:56.000Z"
}
Retrieve a list of all users that are assigned to a policy.
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
[- {
- "userid": "John Doe",
- "expiration": "2022-09-25T12:34:56.000Z",
- "lastuse": "2022-08-26T12:34:56.000Z"
}, - {
- "userid": "Jane Doe",
- "expiration": "2022-09-20T08:30:00.000Z"
}
]
Assign users to a policy
user(s) to assign
userid | string ID of the user |
expiration | string <date-time> ISO time when the assignment will expire |
lastuse | string <date-time> ISO time of last use |
{- "userid": "John Doe"
}
Unassign users from a policy.
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
users to unassign
[- "John Doe",
- "Jane Doe"
]
Retrieve status of a user assigned to a policy.
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
user-id required | string Example: John Doe ID of the user |
{- "userid": "John Doe",
- "expiration": "2022-09-25T12:34:56.000Z",
- "lastuse": "2022-08-26T12:34:56.000Z"
}
Modify the status of a user assigned to a policy
policy-id required | string Example: 0400083B5F6A884600000000 ID of the policy |
user-id required | string Example: John Doe ID of the user |
user assignment status
userid | string ID of the user |
expiration | string <date-time> ISO time when the assignment will expire |
lastuse | string <date-time> ISO time of last use |
{- "expiration": "2022-09-25T12:34:56.000Z"
}
Purchases record what software and hardware has be bought, what rights and conditions held, various expiration, renewal, and warranty dates, and many other aspects of the assets that are owned by an organization. Purchases of software entitlements can be reconciled against the management policies on the server and compared with software installations and usage on computers.
Retrieve a list of all purchases that match an optional filter provided in the query parameter.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "purchase",
- "ident": "0400083B5F6A884600000000"
}, - {
- "type": "purchase",
- "ident": "0400084D5FF8B22A00000000"
}
]
Create a new purchase
purchase to create
ident | string unique ID of the object |
type | string type of this object |
Name | string |
Array of objects (DocumentList) | |
... | any see /api/v2/purchase/schema/items for full list of properties |
{- "ident": "0400083B5F6A884600000000",
- "name": "Acmesoft WordWrite Purchase"
}
Retrieve the properties of an existing purchase.
purchase-id required | string Example: 000106323633363332 ID of the purchase |
fields | string Example: fields=name optional fields to include in response |
{- "type": "purchase",
- "ident": "0400083B5F6A884600000000"
}
Modify the properties of an existing purchase
purchase-id required | string Example: 000106323633363332 ID of the purchase |
purchase properties
ident | string unique ID of the object |
type | string type of this object |
Name | string |
Array of objects (DocumentList) | |
... | any see /api/v2/purchase/schema/items for full list of properties |
{- "entitlements": 20
}
Retrieve a list of all documents for a purchase.
purchase-id required | string Example: 000106323633363332 ID of the purchase |
[- {
- "name": "manifest-20220925.txt",
- "date": "2022-08-25T12:34:56.000Z",
- "file": "/api/v2/purchase/documents/B2359823495/manifest-20220925.txt",
- "store": "ks-store:///prch/B2359823495/manifest-20220925.txt"
}, - {
- "name": "AdvanceTech PowerTower 2000",
- "date": "2022-08-25T12:34:56.000Z",
}
]
Reference documents for a purchase. Use this endpoint to reference web links for a purchase. To store files on the server, use the /api/v2/purchase/documents/{purchase-id} endpoint, which will automatically add a reference for the document.
document(s) to reference
name | string |
date | string <date-time> |
url | string |
file | string |
store | string |
{- "name": "AdvanceTech PowerTower 2000",
}
Remove documents for a purchase.
purchase-id required | string Example: 000106323633363332 ID of the purchase |
documents to remove
[- "manifest-20220925.txt",
- "AdvanceTech PowerTower 2000"
]
Retrieve the information about a document for a purchase.
purchase-id required | string Example: 000106323633363332 ID of the purchase |
document-id required | string Example: invoice-634259.pdf ID of the document |
{- "name": "manifest-20220925.txt",
- "date": "2022-08-25T12:34:56.000Z",
- "file": "/api/v2/purchase/documents/B2359823495/manifest-20220925.txt",
- "store": "ks-store:///prch/B2359823495/manifest-20220925.txt"
}
Modify the information about a document for a purchase
purchase-id required | string Example: 000106323633363332 ID of the purchase |
document-id required | string Example: invoice-634259.pdf ID of the document |
document information
name | string |
date | string <date-time> |
url | string |
file | string |
store | string |
{- "date": "2022-09-25T12:34:56.000Z"
}
Retrieve a list of all documents saved for a purchase.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "document",
- "ident": "invoice-634259.pdf",
- "name": "invoice-634259.pdf",
- "size": 12112,
- "date": "2022-09-25T21:27:32"
}, - {
- "type": "document",
- "ident": "manifest-20220925.txt",
- "name": "manifest-20220925.txt",
- "size": 3785,
- "date": "2022-09-25T15:58:03"
}
]
Remove an existing document. Any reference to the document will be removed from the purchase record.
purchase-id required | string Example: 000106323633363332 ID of the purchase |
document-id required | string Example: invoice-634259.pdf ID of the document |
The names of Users are recorded in usage events, associated with computer hardware, and assigned licenses via policies. The user names typically are those that were used to log into the client OS, although the recorded names might be differnt if there are aliases assigned within KeyServer.
The ID of a User record is the same as the Name. This means a User record cannot be renamed, and after initial creation the Name field is read-only. If necessary, the old record can be deleted and a new record created. However, this will break any associations for the old user record. There are better ways to handle renaming users, for example by assigning aliases. That process is beyond the scope of this document.
Retrieve a list of all users that match an optional filter provided in the query parameter.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "user",
- "ident": "John Doe"
}, - {
- "type": "user",
- "ident": "Jane Doe"
}
]
Create a new user
user to create
ident | string unique ID of the object |
type | string type of this object |
Name | string |
... | any see /api/v2/user/schema/items for full list of properties |
{- "ident": "Jimmy Doe",
- "name": "Jimmy Doe"
}
Retrieve the properties of an existing user.
user-id required | string Example: John Doe ID of the user |
fields | string Example: fields=name optional fields to include in response |
{- "type": "user",
- "ident": "John Doe"
}
Modify the properties of an existing user
user-id required | string Example: John Doe ID of the user |
user properties
ident | string unique ID of the object |
type | string type of this object |
Name | string |
... | any see /api/v2/user/schema/items for full list of properties |
{- "email": "johndoe@sample.org"
}
Date Ranges are convenient pre-defined spans of time that can be used to limit the times on which reports are run. Date Ranges can also be applied to Time Sets to define a certain range of date that a time set is valid.
The ID of a Date Range is the same as the Name. This means a Date Range cannot be renamed, and after initial creation the Name field is read-only. If necessary, the old Date Range can be deleted and a new Date Range created with the same settings but a different name.
Retrieve a list of all date ranges that match an optional filter provided in the query parameter.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "daterange",
- "ident": "Fall 2022"
}, - {
- "type": "daterange",
- "ident": "2020 Q1"
}
]
Create a new date range
date range to create
ident | string unique ID of the object |
type | string type of this object |
Name | string Name for this date range |
StartDate | string <date-time> Start of the date range |
EndDate | string <date-time> End of the date range |
{- "ident": "Fall 2022",
- "StartDate": "20220907000000Z",
- "EndDate": "20221124000000Z"
}
Retrieve the properties of an existing date range.
daterange-id required | string Example: Fall 2022 ID of the date range |
fields | string Example: fields=name optional fields to include in response |
{- "ident": "Fall 2022",
- "type": "daterange",
- "Name": "Fall 2022",
- "StartDate": "20220907000000Z",
- "EndDate": "20221124000000Z"
}
Modify the properties of an existing date range
daterange-id required | string Example: Fall 2022 ID of the date range |
date range properties
ident | string unique ID of the object |
type | string type of this object |
Name | string Name for this date range |
StartDate | string <date-time> Start of the date range |
EndDate | string <date-time> End of the date range |
{- "StartDate": "20220907000000Z",
- "EndDate": "20221124000000Z"
}
Time Sets serve two main purposes. They can be used for defining the "open hours" of Maps pages, and they can be used to refine the times on which reports are run. For Time Sets that are used as a Map's open hours, the name of the Time Set must match the name of the Map. Any time set, whether it is used with a Map or not, can be applied to a report. The report will then only use data that coincides with the times defined by the Time Set.
The ID of a Time Set is the same as the Name. This means a Time Set cannot be renamed, and after initial creation the Name field is read-only. If necessary, the old Time Set can be deleted and a new Time Set created with the same settings but a different name.
Retrieve a list of all time sets that match an optional filter provided in the query parameter.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "timeset",
- "ident": "Second Floor"
}, - {
- "type": "timeset",
- "ident": "Media Workroom"
}
]
Create a new time set
time set to create
ident | string unique ID of the object |
type | string type of this object |
Name | string Name of this time set |
Array of objects Expensive The list of time periods in this time set |
{- "ident": "Second Floor",
- "Periods": [
- {
- "duration": 86400,
- "recurring": [
- "mo",
- "tu",
- "we",
- "th",
- "fr"
], - "start": 0
}
]
}
Retrieve the properties of an existing time set.
timeset-id required | string Example: Second Floor ID of the time set |
fields | string Example: fields=name optional fields to include in response |
{- "ident": "Second Floor",
- "type": "timeset",
- "Name": "Second Floor",
- "Periods": [
- {
- "duration": 86400,
- "recurring": [
- "mo",
- "tu",
- "we",
- "th",
- "fr"
], - "start": 0
}
]
}
Modify the properties of an existing time set
timeset-id required | string Example: Second Floor ID of the time set |
time set properties
ident | string unique ID of the object |
type | string type of this object |
Name | string Name of this time set |
Array of objects Expensive The list of time periods in this time set |
{- "Periods": [
- {
- "duration": 86400,
- "recurring": [
- "mo",
- "we",
- "fr"
], - "start": 0
}
]
}
Reports are used for summarizing and organizing the data gathered by the server. Reports can be used to store historical snapshots for later viewing and reference, and also provide a convenient mid-level cache for much of what is displayed in the Web UI.
The first step in creating a report is to construct or select a report Template. Templates do not contain any data, but rather describe what data to include in a potential report, where to save the report, and when to run it. Templates can be configured to run at a specific scheduled time, run on demand, or run immediately. Typically you would create a template (POST to /report/templates) only when you want to schedule it to run in the future (possibly recurring), or when you want to make the template available for others to run via the Web UI.
If you need to run a report immediately, you can POST a template to the /report/items endpoint. This will queue the report for execution, and return the URI where the completed report will be located once it has completed. How long the report takes to complete will vary widely, and depends on the report type, date range, dataset size, and other settings in the report template.
Once a report has completed it can be accessed within the /report/items container. Completed reports are mostly unchangable, but you can modify a few of the properties such as the title, folder, and notes.
Retrieve a list of all reports that match an optional filter provided in the query parameter.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "report",
- "ident": "api-3d4560b3-69b495f9.ksr"
}, - {
- "type": "report",
- "ident": "52C7332101A1415198273F2A8A21DA81.ksr"
}
]
Create a new report or store a KSR file. If the request data is a report template (application/json) a new report will be queued for execution. If the request data is a KSR file (application/octet-stream) the file will be stored in the Saved Reports archive. Once a KSR is saved in the archive you can move it to a specific folder using a PATCH request.
ident | string unique ID of the object |
type | string type of this object |
title | string Display name for this report |
folder | string Folder where this report is saved |
notes | string Notes for this saved report |
moduleid | integer <int32> ID of the report module used to generate the report |
modulename | string Name of the report module used to generate this report |
dashboard | string To maintain one copy of this report, replacing older copies each time the report is run, provide a unique moniker here. |
update | integer <int32> To update an existing instance of this report that is 'out of date', set this property to a negative value indicating the number of seconds after which the report will be conmsidered out of date. A value for the dashboard property must be provided. |
boolean or string | |
range | string Time range on which to run this report. |
slices | string Time sets on which to run this report. |
object The single subject of the report. | |
object An SQL query filter that selects the subjects of the report. | |
object A list of tags that selects the subjects of the report. | |
object A list of IDs that selects the subjects of the report. | |
object A list of IDs or names that selects the subjects of the report. | |
object A scope that selects the subjects of the report. |
{- "id": 24600,
- "name": "Available Products",
- "dashboard": "org.sample.products-in-locations",
- "update": -86400,
- "subset": {
- "type": "divn",
- "list": [
- "Some Division",
- "Another Division"
]
}
}
Retrieve the properties of an existing report.
report-id required | string Example: api-3d4560b3-69b495f9.ksr ID of the report |
fields | string Example: fields=name optional fields to include in response |
{- "type": "report",
- "ident": "api-3d4560b3-69b495f9.ksr"
}
Check for the presence of a previously submitted report. Response status 200 indicates the report has completed and can be accessed at the URI. Response status 202 indicates the report is still pending completion. Response statuses in the 4xx range mean that the report is not available and will not be created.
report-id required | string Example: api-3d4560b3-69b495f9.ksr ID of the report |
Modify the properties of an existing report
report-id required | string Example: api-3d4560b3-69b495f9.ksr ID of the report |
report properties
ident | string unique ID of the object |
type | string type of this object |
name | string Display name for this report |
folder | string Folder where this report is saved |
notes | string Notes for this saved report |
{- "folder": "Monthly Reports",
- "notes": "Usage summary for the month of September 2022"
}
Retrieve a list of all templates that match an optional filter provided in the query parameter.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "template",
- "ident": "E74072CD3F3949978622805AC6BA88FE"
}, - {
- "type": "templates",
- "ident": "467A0F5D3CBD777DEA730ECD0825149C"
}
]
Create a new report template
report template to create
ident | string unique ID of the object |
type | string type of this object |
title | string Display name for this report |
folder | string Folder where this report is saved |
notes | string Notes for this saved report |
moduleid | integer <int32> ID of the report module used to generate the report |
modulename | string Name of the report module used to generate this report |
dashboard | string To maintain one copy of this report, replacing older copies each time the report is run, provide a unique moniker here. |
update | integer <int32> To update an existing instance of this report that is 'out of date', set this property to a negative value indicating the number of seconds after which the report will be conmsidered out of date. A value for the dashboard property must be provided. |
boolean or string | |
range | string Time range on which to run this report. |
slices | string Time sets on which to run this report. |
object The single subject of the report. | |
object An SQL query filter that selects the subjects of the report. | |
object A list of tags that selects the subjects of the report. | |
object A list of IDs that selects the subjects of the report. | |
object A list of IDs or names that selects the subjects of the report. | |
object A scope that selects the subjects of the report. |
{- "ident": "E74072CD3F3949978622805AC6BA88FE",
- "name": "Current Compliance"
}
Retrieve the properties of an existing report template.
template-id required | string Example: E74072CD3F3949978622805AC6BA88FE ID of the report template |
fields | string Example: fields=name optional fields to include in response |
{- "ident": "E74072CD3F3949978622805AC6BA88FE",
- "type": "template",
- "name": "Current Compliance",
- "moduleid": "24200",
- "modulename": "Compliance (PROD)",
- "category": "prch",
- "uri": "kcfg:///report?id=24200&name=Current%20Compliance&owner=John Doe&time=e&...",
- "author": "John Doe",
- "source": 0,
- "frequency": "n",
- "delay": 0,
- "range": "e",
- "guest": 0,
- "overwrite": 0
}
Replace the properties of an existing report template
template-id required | string Example: E74072CD3F3949978622805AC6BA88FE ID of the report template |
report template properties
ident | string unique ID of the object |
type | string type of this object |
title | string Display name for this report |
folder | string Folder where this report is saved |
notes | string Notes for this saved report |
moduleid | integer <int32> ID of the report module used to generate the report |
modulename | string Name of the report module used to generate this report |
dashboard | string To maintain one copy of this report, replacing older copies each time the report is run, provide a unique moniker here. |
update | integer <int32> To update an existing instance of this report that is 'out of date', set this property to a negative value indicating the number of seconds after which the report will be conmsidered out of date. A value for the dashboard property must be provided. |
boolean or string | |
range | string Time range on which to run this report. |
slices | string Time sets on which to run this report. |
object The single subject of the report. | |
object An SQL query filter that selects the subjects of the report. | |
object A list of tags that selects the subjects of the report. | |
object A list of IDs that selects the subjects of the report. | |
object A list of IDs or names that selects the subjects of the report. | |
object A scope that selects the subjects of the report. |
{- "ident": "E74072CD3F3949978622805AC6BA88FE",
- "name": "Latest Compliance"
}
Modify certain properties of an existing report template
template-id required | string Example: E74072CD3F3949978622805AC6BA88FE ID of the report template |
report template properties
folder | string |
{- "folder": "Automated Reports"
}
Reports saved in the Web UI can be read within the /report/items/... endpoints. The endpoints within each report instance access the data specific to that report. Each report can contain different information, columns, and result rows. The fields available via these endpoints depend on which report was run and the run-time report parameters.
These endpoints are typically used when a report is generated periodically in order to cache information, and the information is then used on web pages or for internal processes. For example, widgets, extras, and other Web UI components will maintain a set of up-to-date reports that can then be queried for summary information via these endpoints.
Retrieve information about the content of a saved report.
report-id required | string Example: api-3d4560b3-69b495f9.ksr ID of the report |
fields | string Example: fields=name optional fields to include in response |
[- {
- "ident": "rnam",
- "type": "info",
- "value": "Usage (PLCY x comp)",
- "kind": "text",
- "index": 0
}, - {
- "ident": "time",
- "type": "info",
- "value": "2023-11-14T12:38:03-0500",
- "kind": "date",
- "index": 1
}, - {
- "ident": "admn",
- "type": "info",
- "value": "Administrator",
- "kind": "text",
- "index": 2
}
]
Retrieve information about the views contained in a saved report.
report-id required | string Example: api-3d4560b3-69b495f9.ksr ID of the report |
fields | string Example: fields=name optional fields to include in response |
[- {
- "ident": "0",
- "type": "view",
- "name": "Usage (PLCY x comp)",
- "index": 0
}, - {
- "ident": "1",
- "type": "view",
- "name": "Usage (comp x PLCY)",
- "index": 1
}
]
Retrieve information about the columns contained in a saved report.
report-id required | string Example: api-3d4560b3-69b495f9.ksr ID of the report |
fields | string Example: fields=name optional fields to include in response |
[- {
- "ident": "name",
- "type": "column",
- "name": "Name",
- "readonly": 1,
- "kind": "text",
- "flags": 16,
- "index": 0
}, - {
- "ident": "ttas",
- "type": "column",
- "name": "Total Time",
- "readonly": 1,
- "description": "Total Time",
- "kind": "lldu",
- "flags": 24578,
- "index": 1
}
]
Retrieve the row data contained in a saved report.
report-id required | string Example: api-3d4560b3-69b495f9.ksr ID of the report |
fields | string Example: fields=name optional fields to include in response |
view | number Example: view=1 optional ID of the report view (defaults to view=0) |
[- {
- "ident": "0",
- "type": "row",
- "objectid": "040008015F55618900",
- "objecttype": "plcy",
- "name": "Bare Bones BBEdit Policy",
- "total_time": "41d 7h",
- "total_count": 14,
- "last_used": "2023-10-25T01:20:54-0400",
- "first_used": "2023-10-01T00:00:00-0400",
- "longest_use": "24d 1h",
- "avg_timewk": "9d 8h",
- "avg_countwk": "3.1",
- "avg_per_use": "2d 23h",
- "_active": "6.7",
- "count_details": 3,
- "index": 0
}, - {
- "ident": "1",
- "type": "row",
- "objectid": "0400083B5F6A884600",
- "objecttype": "plcy",
- "name": "Assembla Cornerstone Policy",
- "total_time": "36d 1h",
- "total_count": 132,
- "last_used": "2023-10-28T05:01:43-0400",
- "first_used": "2023-10-01T00:00:00-0400",
- "longest_use": "8d 4h",
- "avg_timewk": "8d 3h",
- "avg_countwk": "29.8",
- "avg_per_use": "6h 33m",
- "_active": "0.8",
- "count_details": 3,
- "index": 1
}, - {
- "ident": "2",
- "type": "row",
- "objectid": "N03:5F:1E:CE:F1:3D",
- "objecttype": "maid",
- "name": "TFC4621-3360",
- "_usage": "38.0",
- "total_time": "13d 17h",
- "total_count": 3,
- "last_used": "2023-10-19T17:26:03-0400",
- "first_used": "2023-10-01T00:00:00-0400",
- "longest_use": "7d 16h",
- "avg_timewk": "3d 2h",
- "avg_countwk": "0.6",
- "avg_per_use": "4d 14h",
- "_active": "1.2",
- "parent": 0,
- "index": 2
}
]
Availability Maps are organized into Map Sets, which assign computers to the maps based on Divisions or Labeled Tags. A map set defines whether its maps use Divisons or Tags, and which tag is used for tag-based maps. A map set has general properties like a name (title) and description, and contains information relevant to all maps on the map, such as whether the map set is publicaly viewable to all who browse to the server.
Each Map in a map set indicates which Division or Tag label is included on the map. All computer in that Division or with that Tag label are candidates for display on the map's page. Each map has a name (title), description, location, and various options that control how the map is displayed. Maps can have associated graphical layouts, information pages, and time schedules.
Retrieve a list of all map sets that match an optional filter provided in the query parameter.
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "mapset",
- "ident": "std"
}, - {
- "type": "mapset",
- "ident": "second-floor"
}
]
Create a new map set.
ident | string unique ID of the object |
type | string type of this object |
name | string Name for this map set |
title | string Display name for this map set |
description | string Descriptions for this map set |
ptype | string Enum: "divn" "divp" "tagd" Scoping type for this map set |
pname | string Scoping parameter for this map set |
publish | boolean Map set is visible to public viewers |
nogeomap | boolean Map set does not display a location map |
inuse | boolean Map set shows in use status bars instead of availability status bars |
{- "ident": "second-floor",
- "name": "Second Floor",
- "publish": false,
- "ptype": "divn",
- "nogeomap": false,
- "inuse": false
}
Retrieve the properties of an existing map set.
mapset-id required | string Example: second-floor ID of the map set |
fields | string Example: fields=name optional fields to include in response |
{- "ident": "second-floor",
- "type": "mapset",
- "name": "Second Floor",
- "publish": false,
- "ptype": "divn",
- "nogeomap": false,
- "inuse": false,
- "slug": "ZYTNz_s0"
}
Modify the properties of an existing map set
mapset-id required | string Example: second-floor ID of the map set |
report map set properties
ident | string unique ID of the object |
type | string type of this object |
name | string Name for this map set |
title | string Display name for this map set |
description | string Descriptions for this map set |
ptype | string Enum: "divn" "divp" "tagd" Scoping type for this map set |
pname | string Scoping parameter for this map set |
publish | boolean Map set is visible to public viewers |
nogeomap | boolean Map set does not display a location map |
inuse | boolean Map set shows in use status bars instead of availability status bars |
{- "publish": true
}
Retrieve a list of all maps within a map set that match an optional filter provided in the query parameter.
mapset-id required | string Example: second-floor ID of the map set |
fields | string Example: fields=name optional fields to include in response |
query | string optional filter for list results |
[- {
- "type": "map",
- "ident": "8f32df98acbc9a6e83d1b5ed3ca87911"
}, - {
- "type": "map",
- "ident": "7ce53d1dc84f40afa951cd09cee2fc49"
}
]
Create a new map.
mapset-id required | string Example: second-floor ID of the map set |
ident | string unique ID of the object |
type | string type of this object |
name | string Name for this map |
title | string Display name for this map |
description | string Descriptions for this map |
ptype | string Enum: "divn" "divp" "tagd" Scoping type for this map |
pname | string Scoping parameter for this map |
pdata | string Scoping parameter for this map |
publish | boolean Map is visible to public viewers |
noheatmap | boolean Map does not display a heat map |
offavail | boolean Map shows Off status as Available |
{- "name": "Floor2.Room-206",
- "title": "Room 206",
- "ptype": "divn",
- "pname": "Floor2.Room-206",
- "pdata": "0x0000FFFC",
- "publish": true,
- "noheatmap": false,
- "offavail": false
}
Retrieve properties of an existing map.
mapset-id required | string Example: second-floor ID of the map set |
map-id required | string Example: 74a9ab474034b3bccfee28fc04d46e0d ID of the map |
fields | string Example: fields=name optional fields to include in response |
{- "type": "map",
- "ident": "8f32df98acbc9a6e83d1b5ed3ca87911",
- "version": 2,
- "name": "Floor2.Room-206",
- "title": "Room 206",
- "ptype": "divn",
- "pname": "Floor2.Room-206",
- "pdata": "0x0000FFFC",
- "publish": true,
- "noheatmap": false,
- "offavail": false,
- "slug": "N73yuh4c"
}
Change properties of an existing map.
mapset-id required | string Example: second-floor ID of the map set |
map-id required | string Example: 74a9ab474034b3bccfee28fc04d46e0d ID of the map |
ident | string unique ID of the object |
type | string type of this object |
name | string Name for this map |
title | string Display name for this map |
description | string Descriptions for this map |
ptype | string Enum: "divn" "divp" "tagd" Scoping type for this map |
pname | string Scoping parameter for this map |
pdata | string Scoping parameter for this map |
publish | boolean Map is visible to public viewers |
noheatmap | boolean Map does not display a heat map |
offavail | boolean Map shows Off status as Available |
{- "title": "Room 206",
- "publish": true,
- "noheatmap": false
}
When querying for bulk data or constructing results based on data joined from multiple object tables, it might be more efficient to use Bulk SQL Queries instead of using the REST API resource/object endpoints. The data can be queried with standard SQL query select statements, with results returned in a simple rowset format. The Bulk Query Endpoints only support reading data. Queries that modify or delete data are not supported and will return an error result.
When an SQL Error occurs, the response body will contain the error codes and description, and the HTTP status will be 200 OK.
Documentation on the table schema can be found in the KeyServer Platform documentation. That documentation covers all of the available tables and their column definitions, as well as relationships between tables.
Run an SQL query, return results.
level | integer optional level of information in results (0-3) |
SQL query to run
SELECT termID,termValue FROM KSTermLifeStage WHERE (termID < 3)
{- "rows": [
- [
- 0,
- "Deployed"
], - [
- 1,
- "Maintenance"
], - [
- 2,
- "Retired"
]
]
}
Retrieve a list of all tables that can be queried via SQL.
fields | string Example: fields=name optional fields to include in response |
[- {
- "ident": "KSComputerDivisions",
- "type": "sqltable"
}, - {
- "ident": "KSComputerDocuments",
- "type": "sqltable"
}, - {
- "ident": "KSComputers",
- "type": "sqltable"
}
]
Get the full column schema for a given table.
table-name required | string Example: KSComputers Name of the table |
fields | string Example: fields=name optional fields to include in response |
[- {
- "ident": "computerID",
- "type": "sqlcolumn",
- "TABLE_NAME": "KSComputers",
- "COLUMN_NAME": "computerID",
- "DATA_TYPE": 1,
- "TYPE_NAME": "CHAR",
- "COLUMN_SIZE": 63,
- "BUFFER_LENGTH": 63,
- "DECIMAL_DIGITS": 0,
- "NUM_PREC_RADIX": 0,
- "NULLABLE": 0,
- "SQL_DATA_TYPE": 0,
- "SQL_DATETIME_SUB": 0,
- "CHAR_OCTET_LENGTH": 63,
- "ORDINAL_POSITION": 1,
- "IS_NULLABLE": "NO",
- "IS_AUTOINCREMENT": "NO",
- "IS_GENERATEDCOLUMN": "NO"
}, - {
- "ident": "computerName",
- "type": "sqlcolumn",
- "TABLE_NAME": "KSComputers",
- "COLUMN_NAME": "computerName",
- "DATA_TYPE": 1,
- "TYPE_NAME": "CHAR",
- "COLUMN_SIZE": 63,
- "BUFFER_LENGTH": 63,
- "DECIMAL_DIGITS": 0,
- "NUM_PREC_RADIX": 0,
- "NULLABLE": 0,
- "SQL_DATA_TYPE": 0,
- "SQL_DATETIME_SUB": 0,
- "CHAR_OCTET_LENGTH": 63,
- "ORDINAL_POSITION": 3,
- "IS_NULLABLE": "NO",
- "IS_AUTOINCREMENT": "NO",
- "IS_GENERATEDCOLUMN": "NO"
}
]