How to Integrate Oz Liveness into Your Mobile Application
Oz Liveness Mobile SDK implements the ready-to-use face capture user interface that is essential for seamless customer experience and accurate liveness results.
This guide walks you through your first liveness check using Mobile SDK (iOS or Android) and Oz API.
The described flow combines:
Capture mode – the Mobile SDK captures the Liveness video in the app and the Client backend forwards it to Oz API. Capture results are not sent from the SDK straight to Oz API; the Client backend acts as an intermediary.
OzCapsula – a proprietary encrypted binary container. The SDK packages the captured media into it; only Oz API can decrypt and process it. On the device it is an opaque blob – you cannot decode or inspect it, only forward it as-is.
Each step is marked:
[Oz SDK] – call our SDK API.
[Your code] – call your own backend or your own code.
{{host}} in the examples below is the base URL of your Oz API deployment, provided to you during deployment setup.
Requirements
Oz API
6.6.1
iOS SDK
10.0.0
Android SDK
10.0.0
Flutter
10.0.0
Use Content-Type: application/octet-stream for any container uploaded to Oz API.
Before you begin, make sure you have Oz API credentials. When using SaaS API, you get them from us:
For the on-premise Oz API, you need to create a user yourself or ask your team that manages the API. See the guide on user creation via Web Console. Consider the proper user role (CLIENT in most cases or CLIENT ADMIN, if you are going to make SDK work with the pre-created folders from other API users). In the end, you need to obtain a similar set of credentials as you would get for the SaaS scenario.
These parameters are mandatory for OzCapsula to work. Define them in your API configuration file.
We also recommend that you use our logging service called telemetry, as it helps a lot in investigating attacks' details. For Oz API users, the service is enabled by default. For on-premise installations, we'll provide you with credentials.
Oz Liveness Mobile SDK requires a license. License is bound to the bundle_id of your application, e.g., com.yourcompany.yourapp.
Instructions
(your code) Get a session_token from your backend
OzCapsula uses a session token. The token is mandatory for OzCapsula.
Your backend requests a session token from Oz API. Request it before each capture session, as close to the moment the user starts capture as possible.
Endpoint:
Request:
The authorization mechanism for calls to Oz API (access_token) depends on your installation settings: when using Instant API, you can integrate it under your own authorization scheme. If access token is required in your case, please check Authentication. Also, please note that access and session token are different tokens issued for different purposes.
Response:
This token is short-lived (default lifetime: 900 seconds for API Full, 120 seconds for Instant API). Request one per capture session and pass it to the SDK immediately – do not cache or reuse tokens across sessions.
(your code) Send the container to Oz API
Send the encrypted container to your own backend as raw bytes (application/octet-stream). Your backend forwards it to Oz API and returns the analysis response.
Your backend submits the container to Oz API in a single synchronous POST request.
Endpoint (Instant API):
Endpoint (Full API):
Headers:
Content-Type: application/octet-stream(mandatory).X-Forensic-Access-Token: {{access_token}}. (optional, depends on installation settings).
Request body: the raw container bytes – no JSON envelope, no multipart, no base64 wrapping.
Request (Instant API):
Request (Full API):
On success: HTTP 201 with a JSON folder object describing the result. Check Step 7.
On container-level error: HTTP 400 – see Exceptions.
This guide covers the Liveness analysis. To perform a Face Matching analysis within the OzCapsula flow, see How to Perform a Face Matching Analysis within OzCapsula Flow.
(your code) Handle the response
Your backend now has the response – a JSON folder object describing the result.
Make the accept/reject decision using only these two top-level fields:
Interpret system_resolution:
SUCCESS– all checks passed; accept the user.DECLINED– one or more checks failed; reject the user.FAILED– a system error prevented at least one analysis from completing; do not treat as accept or reject.
For per-analysis verdicts (for example, to know whether liveness passed but biometry failed), read $.analyses[*].resolution_status with the values described above.
Checklist
With these steps, you are done with basic integration of Mobile SDKs. You will be able to access recorded media and analysis results in Web Console via browser or programmatically via API.
In developer guides, you can also find instructions for customizing the SDK look-and-feel and access the full list of our Mobile SDK methods. Check out the table below:
Last updated
Was this helpful?
