{"id":19943498,"url":"https://github.com/iproov/android-api-client","last_synced_at":"2025-05-03T15:33:06.670Z","repository":{"id":45593472,"uuid":"298220814","full_name":"iProov/android-api-client","owner":"iProov","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-10T13:07:35.000Z","size":168,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-01-10T14:58:37.372Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iProov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-09-24T08:46:28.000Z","updated_at":"2023-08-18T22:47:25.000Z","dependencies_parsed_at":"2024-01-10T15:09:50.963Z","dependency_job_id":null,"html_url":"https://github.com/iProov/android-api-client","commit_stats":null,"previous_names":[],"tags_count":10,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iProov%2Fandroid-api-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iProov%2Fandroid-api-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iProov%2Fandroid-api-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iProov%2Fandroid-api-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iProov","download_url":"https://codeload.github.com/iProov/android-api-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224365264,"owners_count":17299156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T00:17:01.924Z","updated_at":"2024-11-13T00:17:02.750Z","avatar_url":"https://github.com/iProov.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iProov Android API Client v3.0.0\n\n## 📖 Table of contents\n\n- [Introduction](#introduction)\n- [Registration](#registration)\n- [Installation](#installation)\n- [Supported functionality](#supported-functionality)\n- [Example](#example)\n- [Example App](#example-app)\n\n## Introduction\n\nThe iProov Android API Client is a simple wrapper for the [iProov REST API v2](https://secure.iproov.me/docs.html) written using [Retrofit](https://square.github.io/retrofit/) in Kotlin and [Fuel](https://github.com/kittinunf/fuel) in Kotlin for the HTTP networking and JSON serialization/deserialization using [Gson](https://github.com/google/gson). This thus provides two libraries to choose from, to suit technologies you are used to. We also have an iOS Swift API client available [here](https://github.com/iProov/ios-api-client).\n\nv5 of the [iProov SDK](https://github.com/iProov/android) removed the built-in functionality to obtain tokens using the SDK. This library therefore provides that missing functionality as a separate library, and also provides additional functionality such as the ability to enrol photos.\n\n### Important security notice\n\nThe iProov REST API should only ever be called directly from your back-end, however this library is designed to help you with debugging/evaluating the [iProov Android SDK](https://github.com/iProov/android), to get up-and-running quickly with a pure on-device demo.\n\nUse of the Android API Client requires providing it with your API secret. **You should never embed your API secret within a production app**.\n\n## Registration\n\nYou can obtain API credentials by registering on the [iProov Portal](https://portal.iproov.com/).\n\n## Installation\n\nChoose which of the two libraries to use for easy access to the basic iProov API v2.\n\n+ **kotlinfuel** is built in Kotlin and uses Fuel for network calls\n    + Maven: `com.iproov.android-api-client:kotlin-fuel:1.3.0`\n    + Limited to SDK 19+\n\n+ **kotlinretrofit** is built in Kotlin and uses Retrofit for network calls\n    + Maven `com.iproov.android-api-client:kotlin-retrofit:1.3.0`\n    + Limited to SDK 9+\n\nAdd to the repositories section to your build.gradle file (example shown is in groovy gradle and for kotlin retrofit library):\n\n```gradle\n    repositories {\n        maven { url 'https://raw.githubusercontent.com/iProov/android/master/maven/' }\n    }\n```\n\nAdd the dependencies section to your app build.gradle file:\n\n```gradle\n    dependencies {\n        implementation 'com.iproov.android-api-client:kotlin-retrofit:1.3.0'\n    }\n```\n\nWhen using any of the Kotlin versions, you will also need to add the coroutines dependencies to your app build.gradle file. These or newer:\n\n```gradle\n    dependencies {\n        implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0'\n        implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0'\n    }\n```\n\n## Supported functionality\n\nBoth libraries offer the same functionality:\n\n- **`getToken()`** - Get an enrol/verify token.\n- **`enrolPhoto()`** - Once you have an enrolment token, you can enrol a photo against it.\n- **`validate()`** - Validates an existing token.\n- **`invalidate()`** - Invalidates an existing token.\n- **`enrolPhotoAndGetVerifyToken()`** - A helper function which chains together `getToken()` for the enrolment token, `enrolPhoto()` to enrol the photo, and then `getToken()` for the verify token, which you can then use to launch the SDK.\n\n## Example\n\nExample of using iProov API Client together with iProov to get a verify token for an existing user and then launch the iProov SDK to perform the verification:\n\n##### Kotlin\n```kotlin\nprivate val uiSupervisorJob = SupervisorJob()\nprivate val uiScope = CoroutineScope(Dispatchers.Main + uiSupervisorJob)\n\nval apiClient = ApiClientRetrofit(\n    context = this,\n    baseUrl = \"{{ your base url }}\",\n    logLevel = HttpLoggingInterceptor.Level.BODY,\n    apiKey = \"{{ your API key }}\",\n    secret = \"{{ your API secret }}\")\n\nuiScope.launch {\n    try {\n        val token = withContext(Dispatchers.IO) {\n            apiClient.getToken(AssuranceType.GENUINE_PRESENCE, ClaimType.VERIFY, userId).token\n        }\n        // Pass the token to the iProov SDK\n\n    } catch (httpEx: HttpException) {\n        // Handle exception\n\n    }\n}\n```\n\n## Example App\n\nThe Example App included, written in Kotlin with Coroutines, demonstrates the use with simple text output to both screen and logs.\n\nTo run the example you need to include a *secrets.json* file in the\nsrc/main/assets/ directory that looks like this:\n\n~~~\n{\n  \"base_url\": \u003cYOUR_URL\u003e,\n  \"api_key\": \u003cYOUR_CLIENT_ID\u003e,\n  \"secret\": \u003cYOUR_SECRET\u003e\n}\n~~~\n\nThis file SHOULD NOT be added to the repo. It is excluded by gitignore\nfor your own safety.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiproov%2Fandroid-api-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiproov%2Fandroid-api-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiproov%2Fandroid-api-client/lists"}