GET /status
Requests status information from a BWS installation.
The Status Web API returns a StatusResult
object, containing information about the running BWS installation, like the BWS product Version or the BWS deployment Label. Finally it contains a list of Features your client application can use.
{
"Version": "2.3",
"Label": "BWS 2.3.18128.4",
"Features": [
{ "Name": "QualityCheck", "Traits": "Face,Periocular,Voice", "Storage": null, "Partitions": null },
{ "Name": "LiveDetection", "Traits": "Face,Periocular", "Storage": null, "Partitions": null },
{ "Name": "Enrollment", "Traits": "Face,Periocular,Voice", "Storage": "bws", "Partitions": "112" },
{ "Name": "Verification", "Traits": "Face,Periocular,Voice", "Storage": "bws", "Partitions": "112" },
{ "Name": "Identification", "Traits": "Face,Periocular,Voice", "Storage": "bws", "Partitions": "112" },
{ "Name": "PhotoVerify", "Traits": null, "Storage": null, "Partitions": null }
]
}
The call returns one of the standard HTTP status codes. With the success code (200) you receive the SatusResult
object in the body text. With erroneous codes you typically get a Message field within the body text describing the error.
The most commonly returned codes are:
StatusResult
object.
private static async Task<string>BWSStatusAsync()
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic",
Convert.ToBase64String(Encoding.ASCII.GetBytes($"{APP_IDENTIFIER}:{APP_SECRET}")));
using (var response = await client.GetAsync(ENDPOINT + $"status"))
{
Console.Write("BWSStatus response... ");
if (response.StatusCode == HttpStatusCode.OK)
{
string result = await response.Content.ReadAsStringAsync();
var json = JObject.Parse(result);
// read out status information
string version = (string)json["Version"];
string label = (string)json["Label"];
var features = json["Features"];
Console.WriteLine(json.ToString());
return json.ToString();
}
Console.WriteLine(response.StatusCode.ToString());
return string.Empty;
}
}
}
// using OkHttpClient from the OkHttp library
Request request = new Request.Builder()
.url("https://bws.bioid.com/extension/status")
.addHeader("Authorization", Credentials.basic(APP_IDENTIFIER, APP_SECRET))
.build();
OkHttpClient client = new OkHttpClient();
Response response = client.newCall(request).execute();
if (response.code() == 200) {
// using org.json.JSONObject from JSON-java library
JSONObject json = new JSONObject(response.body().string());
System.out.println("Status: " + json);
}