Join us for an engaging webinar, as we unravel the potential of AI for revolutionizing document management.
Watch Now
Enable your employees to remain productive throughout the document management process.
Read More
Learn how SmartZone uses a regular expression engine integrated into the recognition engine to achieve the best possible accuracy on data that can be defined by a regular expression.
Docubee is an intelligent contact automation platform built to help your team success
I have EML and MSG files that contain attachments. I want to combine the original EML/MSG document with each of its attachments into a single PDF. How can I do this?
To do this you are going to need to create a viewing session for the EML or MSG file. Once you’ve created the viewing session you can get the viewingSessionIds of the attachments. Once you have the viewingSessionIds you can get the workFile ID associated with each viewing session. With the workfile IDs you can use the Content Conversion Service (CCS) to combine the email with its attachments into a single PDF.
viewingSessionIds
workFile
workfile
Use the following API requests to do this:
Create a new viewing session with:
POST {server_base_url}/PCCIS/V1/ViewingSession
This will give you a viewingSessionId which will be used in future requests.
viewingSessionId
The body for this request will be JSON:
{ "render": { "html5": { "alwaysUseRaster": false } } }
Upload the document with:
PUT {server_base_url}/PCCIS/V1/ViewingSession/u{viewingSessionId}/SourceFile?FileExtension={extension}
The request body must be bytes of the source document. Make sure to include the FileExtension or PrizmDoc won’t be able to detect the file as an EML or MSG file.
FileExtension
Poll for and get the viewingSessionIds of the attachments with:
GET {server_base_url}/PCCIS/V1/ViewingSession/u{viewingSessionId}/Attachments
This will return the viewingSessionIds for each of the attachments.
Get the workfile ID for each of the viewing sessions with:
GET {server_base_url}/PCCIS/V1/ViewingSession/u{viewingSessionId}/FileId
You’ll need to get a fileId for each attachment’s viewingSession and the email’s viewingSession.
fileId
viewingSession
With those workfile IDs, you can use the Content Conversion Service (CCS) to combine each of the workfiles with:
workfiles
POST {server_base_url}v2/contentConverters
The body for this request will be JSON and need to include the workfileId for each of the attachments and the email itself. The body would look like this:
workfileId
{ "input": { "sources": [ { "fileId": "{EmailWorkFileId}" }, { "fileId": "{Attachment1WorkFileId}" }, { "fileId": "{Attachment2WorkFileId}" } ], "dest": { "format": "pdf" } } }
This will return a processId that you can poll using:
processId
GET /v2/contentConverters/{processId}
Once the process is complete, the request will return a results array that will contain the fileId of the final document.
results
You can get the final document that contains all the attachments and original EML/MSG file combined into a single PDF with:
GET /PCCIS/V1/WorkFile/{fileId}