In order to retrieve document images from the resources container, we'll want to look for the relevant media ID inside the ID document pages.
For security reasons, Yoti does not include personally identifiable information within the standard response to a session retrieval request. Yoti will provide IDs to media associated with the session, which can be stored and retrieved separately.
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})Retrieve the document ID photo
In order to retrieve a specific portrait ID document image from the resources container, we'll want to look for the relevant media ID inside of the ID document container.
idvClient.getMediaContent(sessionId, documentPhotoId).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})Was this page helpful?