This document lists some examples to solve common tasks with a REST Product Discovery API. For more technical details please refer to the Product Discovery OpenApi (Swagger) specification:
The BellSoft product discovery API has several methods to discover lists of supported operating systems and architectures.
Url: https://api.bell-sw.com/v1/liberica/architectures
JSON response example:
["arm", "ppc", "sparc", "x86"]
Bash example:
curl https://api.bell-sw.com/v1/liberica/architectures
PowerShell example:
Invoke-RestMethod https://api.bell-sw.com/v1/liberica/architectures
Url: https://api.bell-sw.com/v1/liberica/operating-systems
JSON response example:
["linux", "linux-musl", "macos", "solaris", "windows"]
Bash example:
curl https://api.bell-sw.com/v1/liberica/operating-systems
PowerShell example:
Invoke-RestMethod https://api.bell-sw.com/v1/liberica/operating-systems
In this example, we assume that the user knows all user-specific options: bitness, os, etc. So the list of releases will be very short.
JSON response example:
[
{
"bitness": 64,
"buildVersion": 10,
"latestLTS": false,
"os": "windows",
"updateVersion": 1,
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13.0.1+10/bellsoft-jdk13.0.1+10-windows-amd64.zip",
"interimVersion": 0,
"EOL": false,
"latestInFeatureVersion": true,
"LTS": false,
"bundleType": "jdk",
"version": "13.0.1+10",
"featureVersion": 13,
"packageType": "zip",
"sha1": "a2143878d68f67e4cd079d52365b415451c4bf15",
"FX": true,
"filename": "bellsoft-jdk13.0.1+10-windows-amd64.zip",
"installationType": "archive",
"size": 275301289,
"patchVersion": 0,
"GA": true,
"architecture": "x86",
"latest": true
}
]
Bash example:
curl https://api.bell-sw.com/v1/liberica/releases?version-modifier=latest&bitness=64&os=windows&arch=x86&package-type=zip&bundle-type=jdk
PowerShell example:
Invoke-RestMethod https://api.bell-sw.com/v1/liberica/releases?version-modifier=latest&bitness=64&os=windows&arch=x86&package-type=zip&bundle-type=jdk
As in the previous example, we will limit the output using additional user-specific filters.
JSON response example:
[
{
"bitness": 64,
"buildVersion": 11,
"latestLTS": true,
"os": "windows",
"updateVersion": 5,
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.5+11/bellsoft-jdk11.0.5+11-windows-amd64.zip",
"interimVersion": 0,
"EOL": false,
"latestInFeatureVersion": true,
"LTS": true,
"bundleType": "jdk",
"version": "11.0.5+11",
"featureVersion": 11,
"packageType": "zip",
"sha1": "9956658bdc98f844bacbf451b8e8f0622544b539",
"FX": true,
"filename": "bellsoft-jdk11.0.5+11-windows-amd64.zip",
"installationType": "archive",
"size": 265347010,
"patchVersion": 0,
"GA": true,
"architecture": "x86",
"latest": false
}
]
Bash example:
curl https://api.bell-sw.com/v1/liberica/releases?version-modifier=latest&bitness=64&release-type=lts&os=windows&arch=x86&package-type=zip&bundle-type=jdk
PowerShell example:
Invoke-RestMethod https://api.bell-sw.com/v1/liberica/releases?version-modifier=latest&bitness=64&release-type=lts&os=windows&arch=x86&package-type=zip&bundle-type=jdk
In this example we assume that the user knows the name of the file, that was previously downloaded. It is possible to check if the Liberica JDK release is the latest in feature release, or latest LTS release, or simply the latest.
Url: https://api.bell-sw.com/v1/liberica/releases/bellsoft-jdk11.0.5+11-windows-amd64.zip
JSON response example:
{
"bitness": 64,
"buildVersion": 11,
"latestLTS": true,
"os": "windows",
"updateVersion": 5,
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.5+11/bellsoft-jdk11.0.5+11-windows-amd64.zip",
"interimVersion": 0,
"EOL": false,
"latestInFeatureVersion": true,
"LTS": true,
"bundleType": "jdk",
"version": "11.0.5+11",
"featureVersion": 11,
"packageType": "zip",
"sha1": "9956658bdc98f844bacbf451b8e8f0622544b539",
"FX": true,
"filename": "bellsoft-jdk11.0.5+11-windows-amd64.zip",
"installationType": "archive",
"size": 265347010,
"patchVersion": 0,
"GA": true,
"architecture": "x86",
"latest": false
}
Bash example:
curl https://api.bell-sw.com/v1/liberica/releases/bellsoft-jdk11.0.5+11-windows-amd64.zip
Invoke-RestMethod https://api.bell-sw.com/v1/liberica/releases/bellsoft-jdk11.0.5+11-windows-amd64.zip
In this example, we assume that the user knows the version string of Liberica JDK release that was previously downloaded. It is possible to check the flags similar to the previous example.
JSON response example:
[
{
"bitness": 64,
"buildVersion": 11,
"latestLTS": true,
"os": "windows",
"updateVersion": 5,
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.5+11/bellsoft-jdk11.0.5+11-windows-amd64.zip",
"interimVersion": 0,
"EOL": false,
"latestInFeatureVersion": true,
"LTS": true,
"bundleType": "jdk",
"version": "11.0.5+11",
"featureVersion": 11,
"packageType": "zip",
"sha1": "9956658bdc98f844bacbf451b8e8f0622544b539",
"FX": true,
"filename": "bellsoft-jdk11.0.5+11-windows-amd64.zip",
"installationType": "archive",
"size": 265347010,
"patchVersion": 0,
"GA": true,
"architecture": "x86",
"latest": false
}
]
Bash example:
curl https://api.bell-sw.com/v1/liberica/releases?version=11.0.5+11&bitness=64&os=windows&arch=x86&package-type=zip&bundle-type=jdk
PowerShell example:
Invoke-RestMethod https://api.bell-sw.com/v1/liberica/releases?version=11.0.5+11&bitness=64&os=windows&arch=x86&package-type=zip&bundle-type=jdk
This example shows how to discover a link for downloading without parsing JSON.
Response example:
https://github.com/bell-sw/Liberica/releases/download/11.0.5+11/bellsoft-jdk11.0.5+11-windows-amd64.zip
Bash example:
curl https://api.bell-sw.com/v1/liberica/releases?version=11.0.5%2B11&bitness=64&os=windows&arch=x86&package-type=zip&bundle-type=jdk&output=text&fields=downloadUrl
PowerShell example:
Invoke-RestMethod https://api.bell-sw.com/v1/liberica/releases?version=11.0.5%2B11&bitness=64&os=windows&arch=x86&package-type=zip&bundle-type=jdk&output=text&fields=downloadUrl