/// <summary> /// Is Registered /// </summary> /// <param name="id"></param> private static void IsRegister(string id) { CloudABISBiometricRequest biometricRequest = new CloudABISBiometricRequest { RegistrationID = id, CustomerKey = _cloudABISAPICredentials.CustomerKey, EngineName = CloudABISConstant.FINGERPRINT_ENGINE, Token = _cloudABISToken.AccessToken }; //IsRegistered CloudABISResponse matchingResponse = _cloudABISAPI.IsRegistered(biometricRequest); if (matchingResponse != null) { if (matchingResponse.Status.Equals(EnumOperationStatus.SUCCESS)) { Console.WriteLine("IsRegistered: " + matchingResponse.OperationResult); } else { Console.WriteLine("IsRegistered: " + matchingResponse.OperationResult); } } else { Console.WriteLine("Something went wrong!"); } }
/// <summary> /// Identify biometric /// </summary> /// <param name="template">Templte or image</param> /// <param name="token"></param> /// <param name="format">Format value needs only for FingerPrint operation</param> public string Identify(string template, string token, string format = CloudABISConstant.CLOUDABIS_ISO) { CloudABISBiometricRequest biometricRequest = new CloudABISBiometricRequest { BiometricXml = template, CustomerKey = _customerKey, EngineName = _engineName, Format = format, Token = token }; CloudABISAPI cloudABISAPI = new CloudABISAPI(_appkey, _secretKey, _apiBaseUrl); CloudABISResponse matchingResponse = cloudABISAPI.Identify(biometricRequest); if (matchingResponse != null) { if (matchingResponse.OperationName.Equals(EnumOperationName.Identify) && matchingResponse.OperationResult.Equals(CloudABISConstant.MATCH_FOUND)) { return(CloudABISResponseParser.GetResponseMessage(matchingResponse.OperationResult) + ": " + matchingResponse.BestResult.ID); } else { return(CloudABISResponseParser.GetResponseMessage(matchingResponse.OperationResult)); } } else { return("Something went wrong!"); } }
/// <summary> /// Update existing employee/person biometric data /// </summary> /// <param name="template">Templte or image</param> /// <param name="registrationid"></param> /// <param name="token"></param> /// <param name="format">Format value needs only for FingerPrint operation</param> public string Update(string template, string registrationid, string token, string format = CloudABISConstant.CLOUDABIS_ISO) { CloudABISBiometricRequest biometricRequest = new CloudABISBiometricRequest { RegistrationID = registrationid, BiometricXml = template, CustomerKey = _customerKey, EngineName = _engineName, Format = format, Token = token }; CloudABISAPI cloudABISAPI = new CloudABISAPI(_appkey, _secretKey, _apiBaseUrl); CloudABISResponse matchingResponse = cloudABISAPI.Update(biometricRequest); if (matchingResponse != null) { if (matchingResponse.OperationName.Equals(EnumOperationName.Register) && matchingResponse.OperationResult.Equals(CloudABISConstant.SUCCESS)) { return("Update Biometric Success!"); } else { return(CloudABISResponseParser.GetResponseMessage(matchingResponse.OperationResult)); } } else { return("Something went wrong!"); } }
/// <summary> /// Is Registered /// </summary> /// <param name="id"></param> /// <param name="token"></param> /// <returns></returns> public string IsRegister(string id, string token) { CloudABISBiometricRequest biometricRequest = new CloudABISBiometricRequest { RegistrationID = id, CustomerKey = _customerKey, EngineName = _engineName, Token = token }; CloudABISAPI cloudABISAPI = new CloudABISAPI(_appkey, _secretKey, _apiBaseUrl); CloudABISResponse matchingResponse = cloudABISAPI.IsRegistered(biometricRequest); if (matchingResponse != null) { return(CloudABISResponseParser.GetResponseMessage(matchingResponse.OperationResult)); } else { return("Something went wrong!"); } }
/// <summary> /// Verify existing employee/person biometric data /// </summary> /// <param name="template">Templte or image</param> /// <param name="verifyID"></param> /// <param name="token"></param> /// <param name="format">Format value needs only for FingerPrint operation</param> public string Verify(string template, string verifyID, string token, string format = CloudABISConstant.CLOUDABIS_ISO) { CloudABISBiometricRequest biometricRequest = new CloudABISBiometricRequest { RegistrationID = verifyID, BiometricXml = template, CustomerKey = _customerKey, EngineName = _engineName, Format = format, Token = token }; CloudABISAPI cloudABISAPI = new CloudABISAPI(_appkey, _secretKey, _apiBaseUrl); CloudABISResponse matchingResponse = cloudABISAPI.Verify(biometricRequest); if (matchingResponse != null) { return(CloudABISResponseParser.GetResponseMessage(matchingResponse.OperationResult)); } else { return("Something went wrong!"); } }
private static void Register(CloudABISScanrCaptureResponse cloudScanrCaptureResponse, string id) { CloudABISBiometricRequest biometricRequest = new CloudABISBiometricRequest { RegistrationID = id, BiometricXml = cloudScanrCaptureResponse.TemplateData, CustomerKey = _cloudABISAPICredentials.CustomerKey, EngineName = CloudABISConstant.FINGERPRINT_ENGINE, Format = CloudABISConstant.CLOUDABIS_ISO, Token = _cloudABISToken.AccessToken }; //Register Biometric CloudABISResponse matchingResponse = _cloudABISAPI.Register(biometricRequest); if (matchingResponse != null) { if (matchingResponse.Status.Equals(EnumOperationStatus.SUCCESS)) { if (matchingResponse.OperationResult.Equals(CloudABISConstant.MATCH_FOUND)) { Console.WriteLine(CloudABISConstant.MATCH_FOUND + ":" + matchingResponse.BestResult.ID); } else { Console.WriteLine("IdentifyResult:" + matchingResponse.OperationResult); } } else { Console.WriteLine("IdentifyResult: " + matchingResponse.OperationResult); } } else { Console.WriteLine("Something went wrong!"); } }
/// <summary> /// Return Biometric request result /// </summary> /// <param name="requestPath"></param> /// <param name="request"></param> /// <returns></returns> private async Task <CloudABISResponse> DoBiometricOperation(string requestPath, CloudABISBiometricRequest request) { using (var client = new HttpClient()) { try { //setup client client.BaseAddress = new Uri(this._apiBaseUrl); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", request.Token); //make request HttpResponseMessage response = await client.PostAsJsonAsync(requestPath, request); if (response.StatusCode.Equals(HttpStatusCode.OK)) { return(response.Content.ReadAsAsync <CloudABISResponse>().Result); } else { return(new CloudABISResponse { Status = EnumOperationStatus.NONE, OperationResult = response.StatusCode.ToString() }); } } catch (Exception ex) { throw ex; } } }
/// <summary> /// Delete an enrolled member ID and its associated biometric data. /// <para>Operation-specific OperationResult values:</para> /// <br>DeleteID: DS - Deletion successful. (The Member ID and associated biometric data removed from system.)</br> /// <br>DeleteID: DF - Deletion failed.</br> /// <br>DeleteID: ID_NOT_EXIST - The Member ID doesn't exist in the system.</br> /// <para>General OperationResult values:</para> /// <br>CUSTOMER_INFO_NOT_FOUND: The specified CustomerKey was not found in the system. Please contat your vendor for assistance.</br> /// <br>INVALID_ENGINE: The specified EngineName was not valid.</br> /// <br>INVALID_REQUEST: The submitted request was not correctly formatted.</br> /// <br>LICENSE_ERROR: A system license limitation prevented your request from being fulfilled. Please contact your vendor for assistance.</br> /// <br>INTERNAL_ERROR: An unexpected system error was encountered. Please contact your vendor for assistance.</br> /// <br>CACHE_NOT_AVAILABLE: The requested record is not available in the system. Please contact your vendor for assistance.</br> /// </summary> /// <param name="CustomerKey">Customer-specific key provided by the vendor.</param> /// <param name="EngineName"> The engine name for fingerprint biometrics is "FPFF02". The engine name for fingervein biometrics is "FVHT01"The engine name for face biometrics is "FACE01".The engine name for iris biometrics is "IRIS01".</param> /// <param name="RegistrationID">The unique identifier (Member ID) of the biometric enrollment that the requested operation will be performed on.</param> /// <param name="Token">API authenticate token</param> /// <returns></returns> public CloudABISResponse RemoveID(CloudABISBiometricRequest request) { return(Task.Run(() => DoBiometricOperation(CloudABISConstant.CLOUDABIS_REMOVEID_API_PATH, request)).Result); }
/// <summary> /// Update the enrolled biometric data of a member. /// <para>Operation-specific OperationResult values:</para> /// <br>Update: SUCCESS - Update successful. (The biometric data associated with requested Member ID was updated in system.)</br> /// <br>Update: FAILED - Update Failed.</br> /// <br>Update: ID_NOT_EXIST - The Member ID doesn't exist in the system.</br> /// <br>Update: POOR_IMAGE_QUALITY - The submitted iris image(s) were not good enough quality to fulfill the request.</br> /// <br>Identify: MATCH_FOUND - Match found. (The submitted biometric data matched that of an enrolled member.)</br> /// <para>General OperationResult values(FingerVein,Face,Iris):</para> /// <br>INVALID_TEMPLATE: The submitted BiometricXml was not correctly formatted.</br> /// <br>CUSTOMER_INFO_NOT_FOUND: The specified CustomerKey was not found in the system.Please contat your vendor for assistance.</br> /// <br>INVALID_ENGINE: The specified EngineName was not valid.</br> /// <br>INVALID_REQUEST: The submitted request was not correctly formatted.</br> /// <br>LICENSE_ERROR: A system license limitation prevented your request from being fulfilled. Please contact your vendor for assistance.</br> /// <br>INTERNAL_ERROR: An unexpected system error was encountered. Please contact your vendor for assistance.</br> /// <br>CACHE_NOT_AVAILABLE: The requested record is not available in the system. Please contact your vendor for assistance.</br> /// <para>General OperationResult values(FingerPrint):</para> /// <br>INVALID_TEMPLATE: The submitted BiometricXml was not correctly formatted.</br> /// <br>INVALID_ANSI_TEMPLATE: The submitted template in BiometricXml was not valid ANSI template.</br> /// <br>INVALID_ISO_TEMPLATE: The submitted template in BiometricXml was not valid ISO template.</br> /// <br>INVALID_ICS_TEMPLATE: The submitted template in BiometricXml was not valid ICS template.</br> /// <br>CUSTOMER_INFO_NOT_FOUND: The specified CustomerKey was not found in the system. Please contat your vendor for assistance.</br> /// <br>INVALID_ENGINE: The specified EngineName was not valid.</br> /// <br>INVALID_REQUEST: The submitted request was not correctly formatted.</br> /// <br>LICENSE_ERROR: A system license limitation prevented your request from being fulfilled. Please contact your vendor for assistance.</br> /// <br>INTERNAL_ERROR: An unexpected system error was encountered. Please contact your vendor for assistance.</br> /// <br>CACHE_NOT_AVAILABLE: The requested record is not available in the system. Please contact your vendor for assistance.</br> /// </summary> /// <param name="CustomerKey">Customer-specific key provided by the vendor.</param> /// <param name="EngineName"> The engine name for fingerprint biometrics is "FPFF02". The engine name for fingervein biometrics is "FVHT01"The engine name for face biometrics is "FACE01".The engine name for iris biometrics is "IRIS01".</param> /// <param name="RegistrationID">The unique identifier (Member ID) of the biometric enrollment that the requested operation will be performed on.</param> /// <param name="Format">The format of template. It might be ISO/ANSI/ICS. This parameter is need during passing the template.Required only FingerPrint engine</param> /// <param name="BiometricXml">The biometric template with xml formatting</param> /// <param name="Token">API authenticate token</param> /// <returns></returns> public CloudABISResponse Update(CloudABISBiometricRequest request) { return(Task.Run(() => DoBiometricOperation(CloudABISConstant.CLOUDABIS_UPDATE_API_PATH, request)).Result); }
/// <summary> /// Verify against one member's enrolled biometric data. /// <para>Operation-specific OperationResult values:</para> /// <br>Verify: VS - Verification successful. (The submitted biometric data matched the requested member's enrolled biometric data.)</br> /// <br>Verify: VF - Verification failed. (The submitted biometric data did not match the requested member's enrolled biometric data.)</br> /// <br>Verify: ID_NOT_EXIST - The Member ID doesn't exist in the system.</br> /// <br>Verify: POOR_IMAGE_QUALITY - The submitted fingerprint image(s) were not good enough quality to fulfill the request.</br> /// <para>General OperationResult values(FinverVein, Face, Iris):</para> /// <br>INVALID_TEMPLATE: The submitted BiometricXml was not correctly formatted.</br> /// <br>CUSTOMER_INFO_NOT_FOUND: The specified CustomerKey was not found in the system.Please contat your vendor for assistance.</br> /// <br>INVALID_ENGINE: The specified EngineName was not valid.</br> /// <br>INVALID_REQUEST: The submitted request was not correctly formatted.</br> /// <br>LICENSE_ERROR: A system license limitation prevented your request from being fulfilled. Please contact your vendor for assistance.</br> /// <br>INTERNAL_ERROR: An unexpected system error was encountered. Please contact your vendor for assistance.</br> /// <br>CACHE_NOT_AVAILABLE: The requested record is not available in the system. Please contact your vendor for assistance.</br> /// <para>General OperationResult values(FingerPrint):</para> /// <br>INVALID_TEMPLATE: The submitted BiometricXml was not correctly formatted.</br> /// <br>INVALID_ANSI_TEMPLATE: The submitted template in BiometricXml was not valid ANSI template.</br> /// <br>INVALID_ISO_TEMPLATE: The submitted template in BiometricXml was not valid ISO template.</br> /// <br>INVALID_ICS_TEMPLATE: The submitted template in BiometricXml was not valid ICS template.</br> /// <br>CUSTOMER_INFO_NOT_FOUND: The specified CustomerKey was not found in the system. Please contat your vendor for assistance.</br> /// <br>INVALID_ENGINE: The specified EngineName was not valid.</br> /// <br>INVALID_REQUEST: The submitted request was not correctly formatted.</br> /// <br>LICENSE_ERROR: A system license limitation prevented your request from being fulfilled. Please contact your vendor for assistance.</br> /// <br>INTERNAL_ERROR: An unexpected system error was encountered. Please contact your vendor for assistance.</br> /// <br>CACHE_NOT_AVAILABLE: The requested record is not available in the system. Please contact your vendor for assistance.</br> /// </summary> /// <param name="CustomerKey">Customer-specific key provided by the vendor.</param> /// <param name="EngineName"> The engine name for fingerprint biometrics is "FPFF02". The engine name for fingervein biometrics is "FVHT01"The engine name for face biometrics is "FACE01".The engine name for iris biometrics is "IRIS01".</param> /// <param name="RegistrationID">The unique identifier (Member ID) of the biometric enrollment that the requested operation will be performed on.</param> /// <param name="Format">The format of template. It might be ISO/ANSI/ICS. This parameter is need during passing the template.Required only FingerPrint engine</param> /// <param name="BiometricXml">The biometric template with xml formatting</param> /// <param name="Token">API authenticate token</param> /// <returns></returns> public CloudABISResponse Verify(CloudABISBiometricRequest request) { return(Task.Run(() => DoBiometricOperation(CloudABISConstant.CLOUDABIS_VERIFY_API_PATH, request)).Result); }
/// <summary> /// Enroll a member's biometric data. /// <para>Operation-specific OperationResult values:</para> /// <br>Register: SUCCESS - Enrollment successful. (The Member ID and associated biometric data added to system.)</br> /// <br>Register: FAILED - Enrollment failed.</br> /// <br>IsRegistered: YES - There is biometric data enrolled with the requested Member ID.</br> /// <br>Register: POOR_IMAGE_QUALITY - The submitted iris image(s) were not good enough quality to fulfill the request.</br> /// <br>Identify: MATCH_FOUND - Match found. (The submitted biometric data matched that of an enrolled member.)</br> /// <para>General OperationResult values(FingerVein,Face,Iris):</para> /// <br>INVALID_TEMPLATE: The submitted BiometricXml was not correctly formatted.</br> /// <br>CUSTOMER_INFO_NOT_FOUND: The specified CustomerKey was not found in the system.Please contat your vendor for assistance.</br> /// <br>INVALID_ENGINE: The specified EngineName was not valid.</br> /// <br>INVALID_REQUEST: The submitted request was not correctly formatted.</br> /// <br>LICENSE_ERROR: A system license limitation prevented your request from being fulfilled. Please contact your vendor for assistance.</br> /// <br>INTERNAL_ERROR: An unexpected system error was encountered. Please contact your vendor for assistance.</br> /// <br>CACHE_NOT_AVAILABLE: The requested record is not available in the system. Please contact your vendor for assistance.</br> /// <para>General OperationResult values(FingerPrint):</para> /// <br>INVALID_TEMPLATE: The submitted BiometricXml was not correctly formatted.</br> /// <br>INVALID_ANSI_TEMPLATE: The submitted template in BiometricXml was not valid ANSI template.</br> /// <br>INVALID_ISO_TEMPLATE: The submitted template in BiometricXml was not valid ISO template.</br> /// <br>INVALID_ICS_TEMPLATE: The submitted template in BiometricXml was not valid ICS template.</br> /// <br>CUSTOMER_INFO_NOT_FOUND: The specified CustomerKey was not found in the system. Please contat your vendor for assistance.</br> /// <br>INVALID_ENGINE: The specified EngineName was not valid.</br> /// <br>INVALID_REQUEST: The submitted request was not correctly formatted.</br> /// <br>LICENSE_ERROR: A system license limitation prevented your request from being fulfilled. Please contact your vendor for assistance.</br> /// <br>INTERNAL_ERROR: An unexpected system error was encountered. Please contact your vendor for assistance.</br> /// <br>CACHE_NOT_AVAILABLE: The requested record is not available in the system. Please contact your vendor for assistance.</br> /// </summary> /// <param name="CustomerKey">Customer-specific key provided by the vendor.</param> /// <param name="EngineName"> The engine name for fingerprint biometrics is "FPFF02". The engine name for fingervein biometrics is "FVHT01"The engine name for face biometrics is "FACE01".The engine name for iris biometrics is "IRIS01".</param> /// <param name="RegistrationID">The unique identifier (Member ID) of the biometric enrollment that the requested operation will be performed on.</param> /// <param name="Format">The format of template. It might be ISO/ANSI/ICS. This parameter is need during passing the template.Required only FingerPrint engine</param> /// <param name="BiometricXml">The biometric template with xml formatting</param> /// <param name="Token">API authenticate token</param> /// <returns></returns> public CloudABISResponse Register(CloudABISBiometricRequest request) { return(Task.Run(() => DoBiometricOperation(CloudABISConstant.CLOUDABIS_REGISTER_API_PATH, request)).Result); }