Web IsEnrolled API

GET /isenrolled?bcid={BCID}&trait={Trait}


Find out whether a user is already enrolled for a specific trait.

Sometimes it is useful to know whether there is a template available for a specific user and trait before a client tries to perform a verification of this user using this trait. If no template is available, i.e. the user is not yet enrolled, the client could use another authentication mechanism and send the user to the enrollment procedure.

Request Information

Parameters

bcid Required. The Biometric Class ID (BCID) of the person for which to find out whether he or she is enrolled already or not.
trait Required. The biometric trait (e.g. face, or any other of the supported traits) for which to look for a template belonging to the specified person.

Authentication

This API call requires Basic Authentication, i.e. you have to provide an HTTP authorization header using the authorization method Basic and the base64 encoded string App-ID:App-Secret (therefore the transport is secured using TLS/SSL). To receive the necessary BWS Web API access data (App-ID and App-Secret) you have to register your application on the BWS Management Portal first. This requires a valid BWS subscription.

Response Information

The IsEnrolled Web API does not return any response body, it simply returns a HTTP status code indicating whether the user is enrolled (200 OK) or not (404 Not Found).

Response HTTP Status Codes

200 OK A template for the specified BCID and trait is available, a verification of the user is possible.
404 Not Found A template for the specified BCID and trait was not found, i.e. a verification of the user is not possible. The user needs to enroll the specified trait before performing any biometric action on this trait.
400 Bad Request An invalid BCID or trait has been specified.
401 Unauthorized No or an invalid authentication header has been specified, Basic Authentication is required.
403 Forbidden Access has been denied (typically due to a wrong or invalid app-id or BCID).
500 Internal Server Error A server side exception occurred.

Sample Code

using (var client = new HttpClient())
{
    client.DefaultRequestHeaders.Authorization = authenticationHeader;
    using (var response = await client.GetAsync(ENDPOINT + $"isenrolled?id={APP_IDENTIFIER}&bcid={STORAGE}.{PARTITION}.{bcid}&trait=face"))
    {
        return response.StatusCode == HttpStatusCode.OK;
    }
}

jQuery.ajax({
    url: "https://bws.bioid.com/extension/isenrolled",
    type: "GET",
    data: {
        "bcid": `${STORAGE}.${PARTITION}.${CLASS_ID}`,
		"trait": "face"
    },
    headers: {
        "Authorization": "Basic " + btoa(APP_IDENTIFIER + ":" + APP_SECRET),
    },
}).done(function (data, textStatus, jqXHR) {
    console.log("template for face is available");
}).fail(function(jqXHR, textStatus, errorThrown) {
	if(jqXHR.status === 404) {
	    console.log("template for face is not available");
	} else {
		console.log("request failed");
	}
});
// using OkHttpClient from the OkHttp library
HttpUrl url = HttpUrl.parse("https://bws.bioid.com/extension/isenrolled").newBuilder()
        .addQueryParameter("bcid", STORAGE + "." + PARTITION + "." + CLASS_ID)
        .addQueryParameter("trait", "face")
        .build();
Request request = new Request.Builder()
        .url(url)
        .addHeader("Authorization", Credentials.basic(APP_IDENTIFIER, APP_SECRET))
        .build();
OkHttpClient client = new OkHttpClient();
Response response = client.newCall(request).execute();
switch (response.code()) {
    case 200:
        System.out.println("template for face is available");
        break;
    case 404:
        System.out.println("template for face is not available");
        break;
    default:
        System.out.println("request failed");
        break;
}