Retrieve images
In order to retrieve document images from the resources container we'll want to look for the relevant media ID inside of 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 ID's 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 document id photo
In order to retrieve 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?