Media resources

AI Tools

To view all submitted user information related to a session, you will need to use the resources container to find the media id's linked to the user information.

Document resources

The ID documents container includes all the ID document resources which includes ID document images and extracted document data. The documents fields media ID contains the data extracted from the document, and the page media id's will contain the image of the ID document.

idvClient .getSession(sessionId) .then((session) => { // Returns all resources in the session const resources = session.getResources(); // Returns a collection of ID Documents const idDocuments = resources.getIdDocuments(); idDocuments.map((idDocument) => { // Gets the UUID of the document resource const id = idDocument.getId(); // Returns the ID Document Type const documentType = idDocument.getDocumentType(); // Returns the ID Document country const issuingCountry = idDocument.getIssuingCountry(); // Returns pages of an ID Document const pages = idDocument.getPages(); // Get pages media ids const pageMediaIds = pages.map((page) => { if (page.getMedia() && page.getMedia().getId()) { return page.getMedia().getId(); } return null; }); //return document id photo media id const documentPhoto = idDocument.getDocumentIdPhoto().getMedia().getId(); // Returns document fields object const documentFields = idDocument.getDocumentFields(); // Get document fields media id let documentFieldsMediaId = null; if (documentFields) { documentFieldsMediaId = documentFields.getMedia().getId(); } // Get expanded document fields media id const expandedFields = idDocument.getExpandedDocumentFields() const expandedFieldsMediaId = expandedFields.getMedia().getId(); }); }) .catch((error) => { console.log(error); // handle error });
GetSessionResult sessionResult = docScanClient.getSession(sessionId); // Returns all resources in the session ResourceContainer resources = sessionResult.getResources(); // Returns a collection of ID Documents List<? extends IdDocumentResourceResponse> idDocuments = resources.getIdDocuments(); for (IdDocumentResourceResponse idDocument: idDocuments) { // Gets the UUID of the document resource String id = idDocument.getId(); // Returns the ID Document Type String documentType = idDocument.getDocumentType(); // Returns the ID Document country String issuingCountry = idDocument.getIssuingCountry(); // Returns the pages of an ID Document List<? extends PageResponse> pages = idDocument.getPages(); // Get the page media ids ArrayList<String> pageMediaIds = new ArrayList<>(); for (PageResponse page: pages) { if (page.getMedia() != null && page.getMedia().getId() != null) { pageMediaIds.add(page.getMedia().getId()); } } // Get Id docmunent photo media id String documentPhotoMediaId = idDocument.getDocumentIdPhoto().getMedia().getId(); // Returns document fields object DocumentFieldsResponse documentFields = idDocument.getDocumentFields(); // Get document fields media id String documentFieldsMediaId = null; if (documentFields != null) { documentFieldsMediaId = documentFields.getMedia().getId(); } // Returns expanded document fields object ExpandedDocumentFieldsResponse expandedDocumentFields = idDocument.getExpandedDocumentFields(); // Get expanded document fields media id String expandedDocumentFieldsMediaId = null; if (documentFields != null) { expandedDocumentFieldsMediaId = expandedDocumentFields.getMedia().getId(); } }
<?php $sessionResult = $docScanClient->getSession($sessionId); // Returns all resources in the session $resources = $sessionResult->getResources(); // Returns a collection of ID Documents $idDocuments = $resources->getIdDocuments(); foreach ($idDocuments as $idDocument) { // Gets the UUID of the document resource $id = $idDocument->getId(); // Returns the ID Document Type $documentType = $idDocument->getDocumentType(); // Returns the ID Document country $issuingCountry = $idDocument->getIssuingCountry(); // Returns the pages of an ID Document $pages = $idDocument->getPages(); // Get pages media ids $pageMediaIds = []; foreach ($pages as $page) { if ($page->getMedia() && $page->getMedia()->getId()) { array_push($pageMediaIds, $page->getMedia()->getId()); } } // Get Id document photo media id $documentPhotoId = $idDocument->getDocumentIdPhoto()->getMedia()->getId(); // Returns document fields object $documentFields = $idDocument->getDocumentFields(); // Get document fields media id $documentFieldsMediaId; if ($documentFields) { $documentFieldsMediaId = $documentFields->getMedia()->getId(); } // Returns expanded document fields object $expandedDocumentFields = $idDocument->getExpandedDocumentFields(); // Get dexpanded document fields media id $expandedDocumentFieldsMediaId; if ($expandedDocumentFields) { $expandedDocumentFieldsMediaId = $expandedDocumentFields->getMedia()->getId(); } }
session_result = doc_scan_client.get_session(session_id) # Returns all resources in the session resources = session_result.resources # Returns a collection of ID Documents id_documents = resources.id_documents for id_document in id_documents: # Gets the UUID of the document resource id = id_document.id # Returns the ID Document Type document_type = id_document.document_type # Returns the ID Document country issuing_country = id_document.issuing_country # Returns the pages of an ID Document pages = id_document.pages # Get pages media ids page_media_ids = [] for page in pages: if page.media and page.media.id: page_media_ids.append(page.media.id) # Get Id document photo media id document_photo_media_id = id_document.document_photo.media.id # Returns document fields object document_fields = id_document.document_fields # Get document fields media id document_fields_media_id = None if document_fields: document_fields_media_id = document_fields.media.id
GetSessionResult sessionResult = docScanClient.GetSession(sessionId); // Returns all resources in the session ResourceContainer resources = sessionResult.Resources; // Returns a collection of ID Documents List<IdDocumentResourceResponse> idDocuments = resources.IdDocuments; foreach (IdDocumentResourceResponse idDocument in idDocuments) { // Gets the UUID of the document resource string id = idDocument.Id; // Returns the ID Document Type string documentType = idDocument.DocumentType; // Returns the ID Document country string issuingCountry = idDocument.IssuingCountry; // Returns the pages of an ID Document List<PageResponse> pages = idDocument.Pages; // Get the page media ids ArrayList pageMediaIds = new ArrayList(); foreach (PageResponse page in pages) { if (page.Media != null && page.Media.Id != null) { pageMediaIds.Add(page.Media.Id); } } // Get Id document photo media id string documentPhotoMediaId = idDocument.DocumentPhoto.Media.Id; // Returns document fields object DocumentFieldsResponse documentFields = idDocument.DocumentFields; //Get document fields media id string documentFieldsMediaId = null; if (documentFields != null) { documentFieldsMediaId = documentFields.Media.Id; } // Returns expanded document fields object ExpandedDocumentFieldsResponse expandedDocumentFields = idDocument.ExpandedDocumentFields; //Get expanded document fields media id string expandedDocumentFieldsMediaId = null; if (expandedDocumentFields != null) { expandedDocumentFieldsMediaId = expandedDocumentFields.Media.Id; } }
// COMING SOON
{ "id_documents": [ { "id": "f25b7b1a-750c-4826-af50-2ac711556d7e", "tasks": [ { "type": "ID_DOCUMENT_TEXT_DATA_EXTRACTION", "id": "ecdbba2f-9f28-47ec-9e62-039c107a76d5", "state": "DONE", "created": "2026-08-05T10:15:46Z", "last_updated": "2026-08-05T10:16:18Z", "generated_media": [ { "id": "20608d9f-1733-48e0-ae59-9b7e13826afb", "type": "JSON" } ], "recommendation": { "value": "PROGRESS" }, "generated_checks": [] } ], "source": { "type": "END_USER" }, "created_at": "2026-08-05T10:15:46Z", "last_updated": "2026-08-05T10:16:18Z", "document_type": "DRIVING_LICENCE", "issuing_country": "GBR", "pages": [ { "capture_method": "CAMERA", "media": { "id": "40b19d21-ae42-439e-af77-ef32d5b3e8da", "type": "IMAGE", "created": "2026-08-05T10:16:12Z", "last_updated": "2026-08-05T10:16:12Z" }, "frames": [ { "media": { "id": "a36f7d7c-c637-4bf2-a2ff-ac4d3cd210c3", "type": "IMAGE", "created": "2026-08-05T10:16:13Z", "last_updated": "2026-08-05T10:16:13Z" } }, { "media": { "id": "b129bd17-8eeb-4fc0-b5e3-5ac136eba78e", "type": "IMAGE", "created": "2026-08-05T10:16:13Z", "last_updated": "2026-08-05T10:16:13Z" } } ], "extraction_image_ids": [ "40b19d21-ae42-439e-af77-ef32d5b3e8da" ] }, { "capture_method": "CAMERA", "media": { "id": "89c60952-8cf8-498c-8528-af77e99269b4", "type": "IMAGE", "created": "2026-08-05T10:16:12Z", "last_updated": "2026-08-05T10:16:12Z" }, "frames": [ { "media": { "id": "f815d4bc-8c4d-46f0-a883-422e50c6e776", "type": "IMAGE", "created": "2026-08-05T10:16:13Z", "last_updated": "2026-08-05T10:16:13Z" } }, { "media": { "id": "d03726b9-6a1b-45be-8873-14ae83a761d2", "type": "IMAGE", "created": "2026-08-05T10:16:13Z", "last_updated": "2026-08-05T10:16:13Z" } } ], "extraction_image_ids": [ "89c60952-8cf8-498c-8528-af77e99269b4" ] } ], "document_fields": { "media": { "id": "20608d9f-1733-48e0-ae59-9b7e13826afb", "type": "JSON", "created": "2026-08-05T10:16:17Z", "last_updated": "2026-08-05T10:16:17Z" } }, "document_id_photo": { "media": { "id": "6b543156-196b-468e-9099-861d174fc455", "type": "IMAGE", "created": "2026-08-05T10:16:17Z", "last_updated": "2026-08-05T10:16:17Z" } } } ], }

Liveness resources

The liveness container also includes all the liveness and face capture resources.

Passive Liveness

const livenessCapture = resources.getLivenessCapture(); // Returns Passive (Static) liveness resources const staticLivenessResources = resources.getStaticLivenessResources(); staticLivenessResources.forEach((liveness) => { // Get the liveness id const livenessId = liveness.getId(); // Get the liveness image media const livenessMedia = liveness.getImage(); // Get the liveness media id const livenessMediaId = livenessMedia.getId(); });
// Returns Passive (Static) liveness resources List<? extends StaticLivenessResourceResponse> staticLivenessResources = resources.getLivenessCapture(); for (StaticLivenessResourceResponse liveness : staticLivenessResources) { // Get the liveness id String livenessId = liveness.getId(); // Get the liveness image media MediaResponse livenessMedia = liveness.getImage().getMedia(); // Get the liveness media id const livenessMediaId = livenessMedia.getId(); }
// Returns Passive (Static) liveness resources $staticLivenessResources = $resources->getStaticLivenessResources(); foreach ($staticLivenessResources as $liveness) { // Get the liveness id $livenessId = $liveness->getId(); // Get the liveness image media $livenessMedia = $liveness.getImage(); // Get the liveness media id $livenessMediaId = $livenessMedia.getId(); });
// Coming Soon
// Returns Passive (Static) liveness resources List<StaticLivenessResourceResponse> staticLivenessResources = resources.StaticLivenessResourceResponse; foreach (StaticLivenessResourceResponse liveness in staticLivenessResources) { // Get the liveness id String livenessId = liveness.Id; // Get the liveness image media MediaResponse livenessMedia = liveness.image.Media; // Get the liveness media id String livenessMediaId = livenessMedia.Id; }
// Returns Passive (Static) liveness resources staticLivenessResources = resources.staticLivenessResources for _, liveness := range staticLivenessResources { // Get the liveness id livenessId := liveness.ID // Get the liveness image media livenessMedia := livenessImage.Image.Media // Get the liveness media id livenessMediaId := livenessMedia.ID }
{ "liveness_capture": [ { "id": "6509ef13-fedd-47c7-b4f1-8b6748f95745", "tasks": [], "source": { "type": "END_USER" }, "created_at": "2026-08-04T15:37:35Z", "last_updated": "2026-08-04T15:37:46Z", "image": { "media": { "id": "a34ced38-6dc7-4728-b0aa-4f1c3aab2e85", "type": "IMAGE", "created": "2026-08-04T15:37:46Z", "last_updated": "2026-08-04T15:37:46Z" } }, "capture_type": "MULTI_FRAME", "liveness_type": "STATIC" } ] }

Active Liveness

const livenessCapture = resources.getLivenessCapture(); // Returns Active (Zoom) liveness resources const zoomLivenessResources = resources.getZoomLivenessResources(); zoomLivenessResources.forEach((liveness) => { // Get the liveness id const livenessId = liveness.getId(); // Get the liveness facemap const facemap = liveness.getFaceMap(); // Get the liveness frames const frames = liveness.getFrames(); frames.forEach((frame) => { // Get the frame media const frameMedia = frame.getMedia(); // Get the frame media id const frameMediaId = frameMedia.getId(); }); });
// Returns Active (Zoom) liveness resources List<? extends ZoomLivenessResourceResponse> zoomLivenessResources = resources.getZoomLivenessResources(); for (ZoomLivenessResourceResponse liveness : zoomLivenessResources) { // Get the liveness id String livenessId = liveness.getId(); // Get the liveness facemap FaceMapResponse facemap = liveness.getFaceMap(); // Get the liveness frames List<? extends FrameResponse> frames = liveness.getFrames(); for (FrameResponse frame : frames) { // Get the frame media MediaResponse frameMedia = frame.getMedia(); // Get the frame media id String frameMediaId = frameMedia.getId(); } }
// Returns Active (Zoom) liveness resources $zoomLivenessResources = $resources->getZoomLivenessResources(); foreach ($zoomLivenessResources as $liveness) { // Get the liveness id $livenessId = $liveness->getId(); // Get the liveness facemap $facemap = liveness.getFaceMap(); // Get the liveness frames $frames = liveness.getFrames(); foreach ($frames as $frame) { // Get the frame media $frameMedia = $frame->getMedia(); // Get the frame media id $frameMediaId = $frameMedia->getId(); }); });
# Returns Active (Zoom) liveness resources zoom_liveness_resources = resources.zoom_liveness_resources for liveness in zoom_liveness_resources: # Get the liveness id liveness_id = liveness.id # Get the liveness facemap facemap = liveness.facemap # Get the liveness frames frames = liveness.frames for frame in frames: # Get the frame media frame_media = frame.media # Get the frame media id frame_media_id = frame_media.id
// Returns Active (Zoom) liveness resources List<ZoomLivenessResourceResponse> zoomLivenessResources = resources.ZoomLivenessResources; foreach (ZoomLivenessResourceResponse liveness in zoomLivenessResources) { // Get the liveness id string livenessId = liveness.Id; // Get the liveness facemap FaceMapResponse facemap = liveness.FaceMap; // Get the liveness frames List<FrameResponse> frames = liveness.Frames; foreach (ZoomLivenessResourceResponse liveness in zoomLivenessResources) { // Get the frame media MediaResponse frameMedia = frame.Media; // Get the frame media id String frameMediaId = frameMedia.Id; } }
// Returns Active (Zoom) liveness resources zoomLivenessResources = resources.zoomLivenessResources for _, liveness := range zoomLivenessResources { // Get the liveness id livenessId := liveness.ID // Get the liveness facemap facemap := liveness.FaceMap // Get the liveness frames frames := liveness.Frames for _, frame := range frames { // Get the frame media frameMedia := frame.Media // Get the frame media id frameMediaId := frameMedia.ID } }
{ "liveness_capture": [ { "id": "035528b5-4a17-419d-813b-6c5747a49246", "tasks": [], "source": { "type": "END_USER" }, "created_at": "2026-08-04T15:34:34Z", "last_updated": "2026-08-04T15:34:53Z", "frames": [ { "media": { "id": "4ba2bc32-23bd-4fa0-aa5a-d56da9050fcb", "type": "IMAGE", "created": "2026-08-04T15:34:53Z", "last_updated": "2026-08-04T15:34:53Z" } }, { "media": { "id": "45689603-2480-4739-9a94-595fb0461e6a", "type": "IMAGE", "created": "2026-08-04T15:34:52Z", "last_updated": "2026-08-04T15:34:52Z" } }, { "media": { "id": "f8e1b06c-1e55-4a84-b488-3c4d1ebb542d", "type": "IMAGE", "created": "2026-08-04T15:34:53Z", "last_updated": "2026-08-04T15:34:53Z" } } ], "liveness_type": "ZOOM", "facemap": { "media": { "id": "cbe4c32d-c03f-44e3-b8d2-858a79a76962", "type": "BINARY", "created": "2026-08-04T15:34:53Z", "last_updated": "2026-08-04T15:34:53Z" } } } ] }

Supplementary document resources

The supplementary documents container includes all the supplementary document resources which includes the supplementary document image/file and the extracted data.

idvClient .getSession(sessionId) .then((session) => { // Returns all resources in the session const resources = session.getResources(); // Returns a collection of Supplementary Documents const supplementaryDocuments = resources.getSupplementaryDocuments(); supplementaryDocuments.map((supplementaryDocument) => { // Gets the UUID of the document resource const supplementaryID = supplementaryDocument.getId(); // Returns the supplementary Document Type const suppDocumentType = supplementaryDocument.getDocumentType(); // Returns the supplementary Document country const suppIssuingCountry = supplementaryDocument.getIssuingCountry(); // If a file was uploaded const file = supplementaryDocument.getDocumentFile(); const fileMedia = file.getMedia().getId(); // If an image was uploaded - there will only be 1 image in this array const suppPages = supplementaryDocument.getPages(); const suppImageId = suppPages[0].getMedia().getId(); // Returns document fields object const suppDocumentFields = supplementaryDocument.getDocumentFields(); // Get document fields media id let suppDocumentFieldsMediaId = null; if (suppDocumentFields) { suppDocumentFieldsMediaId = suppDocumentFields.getMedia().getId(); } }); }) .catch((error) => { console.log(error); // handle error });
// Click to edit code
// Click to edit code
// Click to edit code
// Click to edit code
// COMING SOON
{ "supplementary_documents": [ { "id": "7fa05ac7-a96e-473c-aca8-f03d611f4b0e", "tasks": [ { "type": "SUPPLEMENTARY_DOCUMENT_TEXT_DATA_EXTRACTION", "id": "e663a7be-a078-4cbd-bb2c-709f985d69df", "state": "DONE", "created": "2026-07-31T09:05:15Z", "last_updated": "2026-07-31T09:05:54Z", "generated_media": [ { "id": "d00db177-89e1-46d4-8424-b8bde28241e7", "type": "JSON" } ], "recommendation": { "value": "PROGRESS" }, "generated_checks": [] } ], "source": { "type": "END_USER" }, "created_at": "2026-07-31T09:05:15Z", "last_updated": "2026-07-31T09:05:54Z", "document_type": "UTILITY_BILL", "issuing_country": "GBR", "pages": [ { "capture_method": "UPLOAD", "media": { "id": "48933dd0-a89d-47c6-ad99-1642873d6741", "type": "IMAGE", "created": "2026-07-31T09:05:53Z", "last_updated": "2026-07-31T09:05:53Z" } } ], "document_fields": { "media": { "id": "d00db177-89e1-46d4-8424-b8bde28241e7", "type": "JSON", "created": "2026-07-31T09:05:54Z", "last_updated": "2026-07-31T09:05:54Z" } } } ] }

Fetching media

Once the media IDs have been successfully retrieved, they can be utilised to fetch the corresponding data. There are two primary data types available for retrieval, an image or JSON data.

Images

idvClient.getMediaContent(sessionId, pageMediaId).then(media => { const buffer = media.getContent(); const base64Content = media.getBase64Content(); const mimeType = media.getMimeType(); // handle base64content or buffer }).catch(error => { console.log(error) // handle error })
Media media = docScanClient.getMediaContent(sessionId, pageMediaId);
<?php $media = $docScanClient->getMediaContent($sessionId, $pageMediaId); $base64Content = $media->getBase64Content(); $contentType = $media->getMimeType();
media = doc_scan_client.get_media_content(session_id, pageMediaId) base64_content = media.base64_content content_type = media.mime_type
MediaValue media = docScanClient.GetMediaContent(sessionId, pageMediaId);
media, err := client.GetMediaContent(sessionId, pageMediaId) if err != nil { panic(err) } mimeType := media.MIME() content := media.Data() base64URL := media.Base64URL()

JSON

idvClient.getMediaContent(sessionId, documentFieldsMediaId).then(media => { const buffer = media.getContent(); const jsonData = JSON.parse(buffer); // handle jsonData here }).catch(error => { // handle error })
Media media = docScanClient.getMediaContent(sessionId, documentFieldsMediaId);
<?php $media = $docScanClient->getMediaContent($sessionId, $documentFieldsMediaId); $data = json_decode($media->getContent());
media = doc_scan_client.get_media_content(session_id, documentFieldsMediaId) data = json.loads(media.content)
MediaValue media = docScanClient.GetMediaContent(sessionId, documentFieldsMediaId);
media, err := client.GetMediaContent(sessionId, pageMediaId) if err != nil { panic(err) }