Playground biometrics demo BioID home page

IsEnrolled Web 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.

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

private static async Task<bool> IsEnrolledAsync(string bcid, Trait trait)
{
    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 + $"isenrolled?bcid={bcid}&trait={trait}"))
        {
            Console.Write("IsEnrolled response... ");
            if (response.StatusCode == HttpStatusCode.OK)
            {
                Console.WriteLine(true);
                return true;
            }

            Console.WriteLine(response.StatusCode.ToString());
            return false;
        }
    }
}
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;
}