Retrieve session PDF

You can retrieve a PDF overview using the session ID returned when you created the session. The session must be COMPLETED.

const payload = new yoti.CreateSessionOverviewPdfPayloadBuilder()
.withIncludeImages(true)
.withIncludeExtractedText(true)
.withIncludeDeviceTracking(true)
.build();

const pdf = await idvClient.createSessionOverviewPdf(sessionId, payload);
const contentType = pdf.getMimeType();
const content = pdf.getContent();

require("fs").writeFileSync("session-overview.pdf", content);
CreateSessionOverviewPdfOptions options = CreateSessionOverviewPdfOptions.builder()
.withIncludeImages(true)
.withIncludeExtractedText(true)
.withIncludeDeviceTracking(true)
.build();

CreateSessionOverviewPdfPayload payload = CreateSessionOverviewPdfPayload.builder()
.withOptions(options)
.build();

Media pdf = docScanClient.createSessionOverviewPdf(sessionId, payload);
String contentType = pdf.getMimeType();
byte[] content = pdf.getContent();

java.nio.file.Files.write(java.nio.file.Paths.get("session-overview.pdf"), content);
var payload = new SessionOverviewPdfPayload(
includeImages: true,
includeExtractedText: true,
includeDeviceTracking: true
);

var pdf = docScanClient.CreateSessionOverviewPdf(sessionId, payload);
string contentType = pdf.GetMIMEType();
byte[] content = pdf.GetContent();

System.IO.File.WriteAllBytes("session-overview.pdf", content);
payload := create.NewSessionOverviewPdfPayload().
WithIncludeImages(true).
WithIncludeExtractedText(true).
WithIncludeDeviceTracking(true)

pdf, err := docScanClient.CreateSessionOverviewPdf(sessionID, payload)
if err != nil {
log.Fatal(err)
}
contentType := pdf.MIME()
content := pdf.Data()

if err := os.WriteFile("session-overview.pdf", content, 0600); err != nil {
log.Fatal(err)
}
log.Println("Content-Type:", contentType)

Use the following options to choose which additional information to include:

Option

Type

Description

include_images

boolean

Include captured images in the PDF.

include_extracted_text

boolean

Include text extracted from documents.

include_device_tracking

boolean

Include device tracking information.

Set an option to true to include that information, or false to exclude it.

The response contains binary PDF data (application/pdf), not JSON. Save the content as a .pdf file or return it from your backend with that content type.

Response codes

Response code

Description

201

PDF generated successfully.

404

SESSION_NOT_FOUND: The session ID could not be found.

409

SESSION_INCOMPLETE: The session is not complete.

429

Number of requests hit the rate limit.