API Versions

An API Version is an integer that uniquely identifies the version of the interfaces used to interact with the underlying KOS system. One can think of an API version as a formal contract between the developer’s code and the software interface. When the KOS system is updated, a new API version may be introduced to signify that the contract has changed, for example, if a method is added, removed, or modified.

These API versions are more granular than general system versions because they track changes at a functional level. While a new release of KOS updates the entire system, not every individual part of the system changes. By using API versions, a developer can distinguish between components that have been updated and those that remain stable.

The KOS environment consists of different modules, specifically KOS Core and extensions such as the Dispense Extension. API versions are module-specific and only hold meaning in relation to their respective systems; for instance, API version 6 in KOS Core is not the same as API version 6 in the Dispense Extension. When beginning a project, the required functionality should be identified and the corresponding API version selected. When selecting a KOS version, it is necessary to ensure that it supports the highest API version required by the application’s features. If an application utilizes multiple APIs across different versions, the chosen KOS environment must be compatible with the entire set of required interfaces.

To maintain forward compatibility, developers should verify whether newer KOS releases continue to support their chosen APIs. If a developer wants to support different API sets depending on which KOS version a device is running, the system provides a specific utility API to retrieve the active API version at runtime. This enables dynamic coding, wherein the application detects the environment it is running in and branches its logic accordingly. By checking the version first, the implementation can switch between different code paths to ensure the software remains fully functional even as the underlying KOS Core version changes.

KOS Core

KOS VersionAPI VersionChange Logs
1.10.111Here
1.10.010Here
1.9.09Here
1.8.28Here
1.7.27Here
1.6.56Here

Dispense Extension

KOS VersionAPI VersionChange Logs
1.10.111Here
1.10.010Here
1.9.09Here
1.8.28Here
1.7.27Here
1.6.56Here

Freestyle Extension

KOS VersionAPI VersionChange Logs
1.10.111Here
1.10.010Here
1.9.09Here
1.8.28Here
1.7.27Here
1.6.56Here

This is an example of how to use the API levels in Java:

// Get the API version of KOS Core at runtime
if (KosCore.getCoreApiVersion() == 9 ) {
    log.info("Kos Core version 9 detected");
} else {
    log.info("Core version {} detected", KosCore.getCoreApiVersion());
}
// Get the API version of the dispense extension at runtime
if (KosCore.getApiVersion("kos.ext.dispense") == 9) {
    log.info("Dispense extension version 9 detected");
} else {
    log.info("Dispense extension version {} detected", KosCore.getApiVersion("kos.ext.dispense"));
}
// Get the SDK's that this app builds against
for (SdkInfo info : this.getSdkList()) {
    log.info( "Info:: app id {} version {} ", info.getAppId(), info.getVersion());
}