Quick Start

AI Tools

We suggest you read through the step-by-step integration guide to understand the integration in detail. Please see below for a quick start example and example projects.

Before you start

You will need to sign in to your Yoti Hub account using your email and password or the Yoti mobile app, and ensure your business is verified with Yoti.

Onboarding with Yoti

Below is an example complete request snippet in different languages.

Install the SDK

npm install -S -E yoti
// If you are using Maven, add the following dependency: <dependency> <groupId>com.yoti</groupId> <artifactId>yoti-sdk-api</artifactId> <version>3.8.0</version> </dependency> // If you are using Gradle, add the following dependency: implementation group: 'com.yoti', name: 'yoti-sdk-api', version: '3.8.0'
// Get the Yoti PHP SDK library via a Composer package composer require yoti/yoti-php-sdk
pip install yoti
// To install the Yoti NuGet package you will need to install NuGet. // To import the latest Yoti SDK into your project, enter the following // command from NuGet Package Manager Console in Visual Studio: Install-Package Yoti // For other installation methods, see https://www.nuget.org/packages/Yoti
// Simply add this as an import: import "github.com/getyoti/yoti-go-sdk/v3" // Or add the following line to your go.mod file require github.com/getyoti/yoti-go-sdk/v3 // Or you can run the following command in your terminal: go get github.com/getyoti/yoti-go-sdk/v3

Create a session

This is an example showing:

  • One document authenticity check

  • Text extraction

  • Liveness

  • Face match.

const path = require('path'); const fs = require('fs'); const { IDVClient, SessionSpecificationBuilder, RequestedDocumentAuthenticityCheckBuilder, RequestedLivenessCheckBuilder, RequestedTextExtractionTaskBuilder, RequestedFaceMatchCheckBuilder, SdkConfigBuilder } = require('yoti'); const YOTI_CLIENT_SDK_ID = 'YOTI_CLIENT_SDK_ID'; const YOTI_PEM = fs.readFileSync(path.join(__dirname, '/path/to/pem')); const idvClient = new IDVClient(YOTI_CLIENT_SDK_ID, YOTI_PEM); // Document Authenticity Check const documentAuthenticityCheck = new RequestedDocumentAuthenticityCheckBuilder() .withManualCheckFallback() .build(); // Liveness check with 3 retries const livenessCheck = new RequestedLivenessCheckBuilder() .forStaticLiveness() .withMaxRetries(3) .build(); // Face Match Check with manual check set to fallback const faceMatchCheck = new RequestedFaceMatchCheckBuilder() .withManualCheckFallback() .build(); // ID Document Text Extraction Task with manual check set to fallback const textExtractionTask = new RequestedTextExtractionTaskBuilder() .withManualCheckFallback() .build(); // Configuration for the client SDK (Frontend) const sdkConfig = new SdkConfigBuilder() .withPresetIssuingCountry('GBR') .withSuccessUrl('/success') .withErrorUrl('/error') .build(); // Buiding the Session with defined specification from above const sessionSpec = new SessionSpecificationBuilder() .withClientSessionTokenTtl(900) .withResourcesTtl(90000) .withUserTrackingId('some-user-tracking-id') .withRequestedCheck(documentAuthenticityCheck) .withRequestedCheck(livenessCheck) .withRequestedCheck(faceMatchCheck) .withRequestedTask(textExtractionTask) .withSdkConfig(sdkConfig) .build(); // Create Session idvClient .createSession(sessionSpec) .then((session) => { const sessionId = session.getSessionId(); const clientSessionToken = session.getClientSessionToken(); const clientSessionTokenTtl = session.getClientSessionTokenTtl(); }) .catch((err) => { // handle err });
import com.yoti.api.client.ClassPathKeySource; import com.yoti.api.client.docs.DocScanClient; import com.yoti.api.client.docs.DocScanException; import com.yoti.api.client.docs.session.create.CreateSessionResult; import com.yoti.api.client.docs.session.create.SdkConfig; import com.yoti.api.client.docs.session.create.SessionSpec; import com.yoti.api.client.docs.session.create.check.RequestedDocumentAuthenticityCheck; import com.yoti.api.client.docs.session.create.check.RequestedFaceMatchCheck; import com.yoti.api.client.docs.session.create.check.RequestedLivenessCheck; import com.yoti.api.client.docs.session.create.task.RequestedIdDocTextExtractionTask; ... DocScanClient docScanClient = DocScanClient.builder() .withClientSdkId("YOTI_CLIENT_SDK_ID") .withKeyPairSource(ClassPathKeySource.fromClasspath("/path/to/pem")) .build(); //Configuration for the client SDK (Frontend) SdkConfig sdkConfig = SdkConfig.builder() .withPresetIssuingCountry("GBR") .withSuccessUrl("https://localhost:8443/success") .withErrorUrl("https://localhost:8443/error") .build(); //Buiding the Session with defined specification SessionSpec sessionSpec = SessionSpec.builder() .withClientSessionTokenTtl(900) .withResourcesTtl(90000) .withUserTrackingId("some-user-tracking-id") .withSdkConfig(sdkConfig) //Document Authenticity Check .withRequestedCheck( RequestedDocumentAuthenticityCheck.builder() .withManualCheckFallback() .build() ) //Face Match Check with manual check set to fallback .withRequestedCheck( RequestedFaceMatchCheck.builder() .withManualCheckFallback() .build() ) //Liveness check with 3 retries .withRequestedCheck( RequestedLivenessCheck.builder() .forStaticLiveness() .withMaxRetries(3) .build() //ID Document Text Extraction Task with manual check set to fallback .withRequestedTask( RequestedIdDocTextExtractionTask.builder() .withManualCheckFallback() .build() ) .build(); //Create session CreateSessionResult sessionResult = docScanClient.createSession(sessionSpec);// Click to edit code
<?php require_once './vendor/autoload.php'; use Yoti\DocScan\DocScanClient; use Yoti\DocScan\Session\Create\Check\RequestedDocumentAuthenticityCheckBuilder; use Yoti\DocScan\Session\Create\Check\RequestedFaceMatchCheckBuilder; use Yoti\DocScan\Session\Create\Check\RequestedLivenessCheckBuilder; use Yoti\DocScan\Session\Create\SdkConfigBuilder; use Yoti\DocScan\Session\Create\SessionSpecificationBuilder; use Yoti\DocScan\Session\Create\Task\RequestedTextExtractionTaskBuilder; use Yoti\DocScan\Session\Create\NotificationConfigBuilder; $YOTI_CLIENT_SDK_ID = 'YOTI_CLIENT_SDK_ID'; $YOTI_PEM = '/path/to/pem'; $client = new DocScanClient($YOTI_CLIENT_SDK_ID, $YOTI_PEM); $sessionSpec = (new SessionSpecificationBuilder()) ->withClientSessionTokenTtl(900) ->withResourcesTtl(90000) ->withUserTrackingId('some-user-tracking-id') ->withRequestedCheck( (new RequestedDocumentAuthenticityCheckBuilder()) ->withManualCheckFallback() ->build() ) ->withRequestedCheck( (new RequestedLivenessCheckBuilder()) ->forStaticLiveness() ->withMaxRetries(3) ->build() ) ->withRequestedCheck( (new RequestedFaceMatchCheckBuilder()) ->withManualCheckFallback() ->build() ) ->withRequestedTask( (new RequestedTextExtractionTaskBuilder()) ->withManualCheckFallback() ->build() ) ->withSdkConfig( (new SdkConfigBuilder()) ->withPrimaryColour('#2d9fff') ->withPresetIssuingCountry('GBR') ->withSuccessUrl('/your/success/url') ->withErrorUrl('/your/error/url') ->withAllowHandoff(true) ->build() ) ->withNotifications( (new NotificationConfigBuilder()) ->withEndpoint('https://yourdomain.example/idverify/updates') ->withAuthToken('username:password') ->forResourceUpdate() ->forTaskCompletion() ->forCheckCompletion() ->forSessionCompletion() ->build() ) ->build(); $session = $client->createSession($sessionSpec);
from yoti_python_sdk.doc_scan import ( DocScanClient, RequestedDocumentAuthenticityCheckBuilder, RequestedFaceMatchCheckBuilder, RequestedLivenessCheckBuilder, RequestedTextExtractionTaskBuilder, SdkConfigBuilder, SessionSpecBuilder, NotificationConfigBuilder ) YOTI_CLIENT_SDK_ID = 'YOTI_CLIENT_SDK_ID' YOTI_PEM = '/path/to/pem' doc_scan_client = DocScanClient(YOTI_CLIENT_SDK_ID, YOTI_PEM) sdk_config = ( SdkConfigBuilder() .with_primary_colour("#2d9fff") .with_preset_issuing_country("GBR") .with_success_url("/your/success/url") .with_error_url("/your/error/url") .build() ) notification_config = ( NotificationConfigBuilder() .with_endpoint('https://yourdomain.example/idverify/updates') .with_auth_token('username:password') .for_resource_update() .for_task_completion() .for_check_completion() .for_session_completion() .build() ) session_spec = ( SessionSpecBuilder() .with_client_session_token_ttl(900) .with_resources_ttl(90000) .with_user_tracking_id("some-user-tracking-id") .with_requested_check( RequestedDocumentAuthenticityCheckBuilder() .with_manual_check_fallback() .build() ) .with_requested_check( RequestedLivenessCheckBuilder() .with_liveness_type("STATIC") .with_max_retries(3) .build() ) .with_requested_check( RequestedFaceMatchCheckBuilder().with_manual_check_fallback().build() ) .with_requested_task( RequestedTextExtractionTaskBuilder().with_manual_check_fallback().build() ) .with_sdk_config(sdk_config) .with_notifications(notification_config) .build() ) session = doc_scan_client.create_session(session_spec)
using System.IO; using System.Net.Http; using Yoti.Auth; using Yoti.Auth.DocScan; using Yoti.Auth.DocScan.Session.Create; using Yoti.Auth.DocScan.Session.Create.Check; using Yoti.Auth.DocScan.Session.Create.Task; ... const string YOTI_CLIENT_SDK_ID = "YOTI_CLIENT_SDK_ID"; const string PEM_PATH = "/path/to/pem"; StreamReader privateKeyStream = System.IO.File.OpenText(PEM_PATH); var key = CryptoEngine.LoadRsaKey(privateKeyStream); var docScanClient = new DocScanClient(YOTI_CLIENT_SDK_ID, key, new HttpClient()); var sessionSpec = new SessionSpecificationBuilder() .WithClientSessionTokenTtl(900) .WithResourcesTtl(90000) .WithUserTrackingId("some-user-tracking-id") .WithRequestedCheck( new RequestedDocumentAuthenticityCheckBuilder() .WithManualCheckFallback() .Build() ) .WithRequestedCheck( new RequestedLivenessCheckBuilder() .ForStaticLiveness() .WithMaxRetries(3) .Build() ) .WithRequestedCheck( new RequestedFaceMatchCheckBuilder() .WithManualCheckFallback() .Build() ) .WithRequestedTask( new RequestedTextExtractionTaskBuilder() .WithManualCheckFallback() .Build() ) .WithNotifications( new NotificationConfigBuilder() .WithEndpoint("https://yourdomain.example/idverify/updates") .WithAuthToken("username:password") .ForResourceUpdate() .ForTaskCompletion() .ForCheckCompletion() .ForSessionCompletion() .Build() ) .WithSdkConfig( new SdkConfigBuilder() .WithPrimaryColour("#2d9fff") .WithPresetIssuingCountry("GBR") .WithSuccessUrl(Path.Combine("/success")) .WithErrorUrl(Path.Combine("/error")) .WithAllowHandoff(true) .Build() ) .Build(); CreateSessionResult createSessionResult = docScanClient.CreateSession(sessionSpec); ...
package main import ( "io/ioutil" "github.com/getyoti/yoti-go-sdk/v3/docscan" "github.com/getyoti/yoti-go-sdk/v3/docscan/session/create" "github.com/getyoti/yoti-go-sdk/v3/docscan/session/create/check" "github.com/getyoti/yoti-go-sdk/v3/docscan/session/create/filter" "github.com/getyoti/yoti-go-sdk/v3/docscan/session/create/objective" "github.com/getyoti/yoti-go-sdk/v3/docscan/session/create/task" ) var ( sdkId string key []byte client *docscan.Client createSessionResult *create.SessionResult ) func main() { sdkId := "YOTI_CLIENT_SDK_ID" key, _ := ioutil.ReadFile("/path/to/pem") client, err := docscan.NewClient(sdkId, key) sessionSpec, err := buildSessionSpec() createSessionResult, err = client.CreateSession(sessionSpec) sessionId := createSessionResult.SessionID clientSessionToken := createSessionResult.ClientSessionToken } func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) { var faceMatchCheck *check.RequestedFaceMatchCheck faceMatchCheck, err = check.NewRequestedFaceMatchCheckBuilder(). WithManualCheckFallback(). Build() if err != nil { return nil, err } var documentAuthenticityCheck *check.RequestedDocumentAuthenticityCheck documentAuthenticityCheck, err = check.NewRequestedDocumentAuthenticityCheckBuilder(). WithManualCheckFallback(). Build() if err != nil { return nil, err } var livenessCheck *check.RequestedLivenessCheck livenessCheck, err = check.NewRequestedLivenessCheckBuilder(). ForStaticLiveness(). WithMaxRetries(3). Build() if err != nil { return nil, err } var textExtractionTask *task.RequestedTextExtractionTask textExtractionTask, err = task.NewRequestedTextExtractionTaskBuilder(). WithManualCheckFallback(). Build() if err != nil { return nil, err } var sdkConfig *create.SDKConfig sdkConfig, err = create.NewSdkConfigBuilder(). WithPrimaryColour("#2d9fff"). WithPresetIssuingCountry("GBR"). WithSuccessUrl("https://localhost:8080/success"). WithErrorUrl("https://localhost:8080/error"). Build() if err != nil { return nil, err } sessionSpec, err = create.NewSessionSpecificationBuilder(). WithClientSessionTokenTTL(900). WithResourcesTTL(90000). WithUserTrackingID("some-tracking-id"). WithRequestedCheck(faceMatchCheck). WithRequestedCheck(documentAuthenticityCheck). WithRequestedCheck(livenessCheck). WithRequestedTask(textExtractionTask). WithSDKConfig(sdkConfig). Build() if err != nil { return nil, err } return sessionSpec, nil }
{ "client_session_token_ttl": 900, "resources_ttl": 90000, "user_tracking_id": "some-user-tracking-id", "block_biometric_consent": false, "requested_checks": [ { "type": "ID_DOCUMENT_AUTHENTICITY", "config": { "manual_check": "FALLBACK" } }, { "type": "LIVENESS", "config": { "liveness_type": "STATIC", "max_retries": 3 } }, { "type": "ID_DOCUMENT_FACE_MATCH", "config": { "manual_check": "FALLBACK" } } ], "requested_tasks": [ { "type": "ID_DOCUMENT_TEXT_DATA_EXTRACTION", "config": { "manual_check": "FALLBACK" } } ], "sdk_config": { "primary_colour": "#2d9fff", "preset_issuing_country": "GBR", "success_url": "https://localhost:8443/success", "error_url": "https://localhost:8443/error", "allow_handoff": true } }

Launch the user interface

The next step is to load the Yoti client SDK. After a session is created a session id and a session token is received, we then use these to construct a URL which loads the Yoti Client SDK:

https://api.yoti.com/idverify/v1/web/index.html?sessionID=<sessionID>&sessionToken=<sessionToken>

Retrieve results

The final step is to retrieve the results of the verification. Session retrieval requires the session ID, that was generated from the create a session endpoint. Below is a basic example of what retrieving a session looks like:

// Returns a session result idvClient.getSession(sessionId).then(session => { // Returns the session state const state = session.getState(); // Returns session resources const resources = session.getResources(); // Returns all checks on the session const checks = session.getChecks(); // Return specific check types const authenticityChecks = session.getAuthenticityChecks(); const faceMatchChecks = session.getFaceMatchChecks(); const textDataChecks = session.getTextDataChecks(); const livenessChecks = session.getLivenessChecks(); const watchlistScreeningChecks = session.getWatchlistScreeningChecks(); const watchlistAdvancedCaChecks = session.getWatchlistAdvancedCaChecks(); // Returns biometric consent timestamp const biometricConsent = session.getBiometricConsentTimestamp(); }).catch(error => { // handle error })
// Returns a session result GetSessionResult sessionResult = docScanClient.getSession(sessionId); // Returns the session state String state = sessionResult.getState(); // Returns session resources ResourceContainer resources = sessionResult.getResources(); // Returns all checks on the session List<? extends CheckResponse> checks = sessionResult.getChecks(); // Return specific check types List<AuthenticityCheckResponse> authenticityChecks = sessionResult.getAuthenticityChecks(); List<FaceMatchCheckResponse> faceMatchChecks = sessionResult.getFaceMatchChecks(); List<TextDataCheckResponse> textDataChecks = sessionResult.getTextDataChecks(); List<LivenessCheckResponse> livenessChecks = sessionResult.getLivenessChecks(); List<WatchlistScreeningCheckResponse> watchlistScreeningChecks = getSessionResult.getWatchlistScreeningChecks(); List<WatchlistAdvancedCaCheckResponse> watchlistAdvancedCaChecks = getSessionResult.getWatchlistAdvancedCaChecks(); // Returns biometric consent timestamp String biometricConsent = sessionResult.getBiometricConsentTimestamp();
<?php // Returns a session result $sessionResult = $docScanClient->getSession($sessionId); // Returns the session state $state = $sessionResult->getState(); // Returns session resources $resources = $sessionResult->getResources(); // Returns all checks on the session $checks = $sessionResult->getChecks(); // Return specific check types $authenticityChecks = $sessionResult->getAuthenticityChecks(); $faceMatchChecks = $sessionResult->getFaceMatchChecks(); $textDataChecks = $sessionResult->getTextDataChecks(); $livenessChecks = $sessionResult->getLivenessChecks(); $watchlistScreeningChecks = $sessionResult->getWatchlistScreeningChecks(); $watchlistAdvancedCaChecks = $sessionResult->getWatchlistAdvancedCaChecks(); // Returns biometric consent timestamp $biometricConsent = $sessionResult->getBiometricConsentTimestamp();
# Returns a session result session_result = doc_scan_client.get_session(session_id) # Returns the session state state = session_result.state # Returns session resources resources = session_result.resources # Returns all checks on the session checks = session_result.checks # Return specific check types authenticity_checks = session_result.authenticity_checks face_match_checks = session_result.face_match_checks text_data_checks = session_result.text_data_checks liveness_checks = session_result.liveness_checks # Returns biometric consent timestamp biometric_consent = session_result.biometric_consent_timestamp
// Returns a session result GetSessionResult sessionResult = docScanClient.GetSession(sessionId); // Returns the session state string state = sessionResult.State; // Returns session resources ResourceContainer resources = sessionResult.Resources; // Returns all checks on the session List<CheckResponse> checks = sessionResult.Checks; // Return specific check types List<AuthenticityCheckResponse> authenticityChecks = sessionResult.GetAuthenticityChecks(); List<FaceMatchCheckResponse> faceMatchChecks = sessionResult.GetFaceMatchChecks(); List<TextDataCheckResponse> textDataChecks = sessionResult.GetTextDataChecks(); List<LivenessCheckResponse> livenessChecks = sessionResult.GetLivenessChecks(); // Returns biometric consent timestamp DateTime biometricConsent = sessionResult.BiometricConsentTimestamp();
// Click to edit code
{ "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "client_session_token_ttl": 599, "user_tracking_id": "string", "biometric_consent": "2023-04-13T10:58:32.627Z", "state": "COMPLETED", "client_session_token": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "resources": { "id_documents": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "source": { "type": "END_USER" }, "document_type": "PASSPORT", "issuing_country": "string", "pages": [ { "capture_method": "CAMERA", "media": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "IMAGE", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" }, "frames": [ { "media": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "IMAGE", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" } } ] } ], "document_fields": { "media": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "JSON", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" } }, "document_id_photo": { "media": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "IMAGE", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" } }, "created_at": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z", "tasks": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "state": "DONE", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z", "generated_media": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "IMAGE" } ], "generated_checks": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "ID_DOCUMENT_TEXT_DATA_CHECK" } ], "type": "ID_DOCUMENT_TEXT_DATA_EXTRACTION" } ] } ], "liveness_capture": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "source": { "type": "END_USER" }, "liveness_type": "STATIC", "facemap": { "media": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "IMAGE", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" } }, "frames": [ { "media": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "IMAGE", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" } } ], "created_at": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z", "tasks": [], "image": { "media": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "IMAGE", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" } } } ], "face_capture": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "source": { "type": "END_USER" }, "image": { "media": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "IMAGE", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" } }, "created_at": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z", "tasks": [] } ] }, "checks": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "ID_DOCUMENT_AUTHENTICITY", "state": "CREATED", "resources_used": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6" ], "generated_media": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "JSON" } ], "report": { "recommendation": { "value": "APPROVE" }, "breakdown": [ { "sub_check": "string", "result": "PASS", "details": [] } ] }, "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" }, { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "ID_DOCUMENT_TEXT_DATA_CHECK", "state": "CREATED", "resources_used": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6" ], "generated_media": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "JSON" } ], "report": { "recommendation": { "value": "APPROVE" }, "breakdown": [ { "sub_check": "string", "result": "PASS", "details": [] } ] }, "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" }, { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "LIVENESS", "state": "CREATED", "resources_used": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6" ], "generated_media": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "IMAGE" } ], "report": { "recommendation": { "value": "APPROVE" }, "breakdown": [ { "sub_check": "string", "result": "PASS", "details": [] } ] }, "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" }, { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "ID_DOCUMENT_FACE_MATCH", "state": "CREATED", "resources_used": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6" ], "generated_media": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "IMAGE" } ], "report": { "recommendation": { "value": "APPROVE" }, "breakdown": [ { "sub_check": "string", "result": "PASS", "details": [] } ] }, "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" }, { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "WATCHLIST_SCREENING", "state": "CREATED", "resources_used": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6" ], "generated_media": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "JSON" } ], "generated_profile": { "media": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "JSON", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" } }, "report": { "recommendation": { "value": "APPROVE" }, "breakdown": [ { "sub_check": "string", "result": "PASS", "details": [] } ], "watchlist_summary": { "total_hits": 0, "search_config": { "categories": [ "ADVERSE-MEDIA" ] }, "raw_results": { "media": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "JSON", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" } }, "associated_country_codes": [ "GBR", "USA" ] } }, "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" }, { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "WATCHLIST_ADVANCED_CA", "state": "CREATED", "resources_used": [ "3fa85f64-5717-4562-b3fc-2c963f66afa6" ], "generated_media": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "JSON" } ], "generated_profile": { "media": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "JSON", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" } }, "report": { "recommendation": { "value": "APPROVE" }, "breakdown": [ { "sub_check": "string", "result": "PASS", "details": [] } ], "watchlist_summary": { "total_hits": 0, "search_config": { "categories": [ "ADVERSE-MEDIA" ] }, "raw_results": { "media": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "JSON", "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" } }, "associated_country_codes": [ "GBR", "USA" ] } }, "created": "2021-06-11T11:39:24Z", "last_updated": "2021-06-11T11:39:24Z" } ] }

Retrieve media

All data captured in an identity verification session can be fetched. Each data point is linked to a specific media id, the media id is then used in an API call to retrieve it's related media. Below is a basic example of what retrieving media looks like:

idvClient.getMediaContent(sessionId, mediaId).then(media => { const buffer = media.getContent(); }).catch(error => { // handle error })
Media media = docScanClient.getMediaContent(sessionId, mediaId);
<?php $media = $docScanClient->getMediaContent($sessionId, $mediaId);
media = doc_scan_client.get_media_content(session_id, mediaId)
MediaValue media = docScanClient.GetMediaContent(sessionId, mediaId);
// Click to edit code

Delete session and media

It is possible to delete a session or images (media). This can only be done once the session is completed.

Deleting the session will also delete all media from that session. It's also possible to delete a single piece of media. Deleting a media object will delete only that specific object, leaving the rest of the session untouched.

idvClient.deleteSession(sessionId).then(() => { // Session has been deleted }).catch(error => { // Error occured }) idvClient.deleteMediaContent(sessionId, mediaId).then(() => { // Media has been deleted }).catch(error => { // Error occured })
docScanClient.deleteSession(sessionId); docScanClient.deleteMediaContent(sessionId, mediaId);
$docScanClient->deleteSession($sessionId); $docScanClient->deleteMediaContent($sessionId, $mediaId);
doc_scan_client->delete_session(session_id); doc_scan_client->delete_media_content(session_id, media_id);
docScanClient.DeleteSession(sessionId); docScanClient.DeleteMediaContent(sessionId, mediaId);
// Click to edit code