Integrate your enterprise email inbox with Document Information Extraction Service via SAP Cloud Integration
Many organizations are using generic enterprise mailboxes to receive emails from their customers, suppliers and other parties, such an email address could for example be firstname.lastname@example.org . Via those enterprise mailboxes organizations receive different types of emails, like requests, feedback, orders and much more. The received emails also often contain different types of attachments, for example documents which must be processed further within the organization.
The automation of processing relevant business documents can increase productivity of organizations and reduce manual tasks. To automate the processing of relevant business documents the SAP AI Business Service Document Information Extraction can be leveraged.
With the newly released SAP Cloud Integration package SAP provides an integration flow, which connects an enterprise email inbox with Document Information Extraction. The integration flow checks the configured email inbox folder for newly received emails every 30 seconds, picks up the unread emails and processes them one after another. During the processing the attachment is extracted and send to the Document Information Extraction service. The extracted information is sent back to an email address which can be configured within the integration flow.
This integration package can help you to kick-start any scenarios which involve email inbox processing, even when your scenario looks slightly different. One example is the blog post about Handling incoming Orders with SAP Cloud Platform which describes a more complex order entry scenario. This scenario also includes further decision and workflow logic via SAP Cloud Platform Business Rules and SAP Cloud Platform Workflow.
If you are new to Document Information Extraction, you can check out the previous Document Information Extraction blog post; I would also recommend you to check out the official help documentation for Document Information Extraction.
If you are new to SAP Cloud Platform Integration I would also recommend you to check out the official help documentation for SAP Cloud Platform Integration.
Let me now explain you how exactly you can setup the integration between your email inbox and Document Information Extraction using SAP Cloud Platform Integration.
Setting up Document Information Extraction
In order to use Document Information Extraction, you need to create a service instance and a service key.
You can use this booster to create the Document Information Extraction instance and its service key quickly in just a few steps.
Configuration of the SAP Cloud Integration Flow
The integration flow which integrates Document Information Extraction Service with the email server is available on SAP API Business Hub.
In order to activate and use the integration flow you need to have SAP Cloud Platform Integration enabled. In case your SAP Cloud Integration is not setup you can follow this tutorial.
If this prerequisite is met, you can follow the steps below to configure the SAP Cloud Integration for Document Information Extraction service.
User Credentials Setup
You need to access the “Manage Security Material” section in order to create new user credentials for the Document Information Extraction integration:
1.) Go to “Manage Security Material” section in SAP Cloud Integration.
2.) Click “Create” and select “User Credentials”.
3.) Add User Credentials with the following settings and click “Deploy”
- Input Name as DOX_USER
- Select Type as User Credentials.
- Input User with <clientid> from the Document Information Extraction service key JSON file.
- Input Password with <clientsecret> from the Document Information Extraction service key JSON file.
Populate an Integration Flow Artifact
In this step we discover and copy the integration package for Document Information Extraction service into your SAP Cloud Integration tenant.
1.) Enter the “Discover” section of SAP Cloud Integration and use the search to search for “SAP AI Business Service Document Information Extraction”.
2.) Copy the package named “SAP AI Business Service Document Information Extraction Integration with Email Server”.
3.) Once the package is copied, go to the “Design” view and search for “SAP AI Business Service Document Information Extraction Integration with Email Server”. Select the displayed entry.
4.) In the package “SAP AI Business Service Document Information Extraction Integration with Email Server” you should be able to see one integration flow artifact.
- Select “Configure” for this integration flow artifact.
Integration Flow Configuration for Mailbox
In this step we configure the email inbox settings of the integration flow in integration package for Document Information Extraction service.
1.) In the “Sender” section configure your email inbox settings of the email inbox you want to integrate with Document Information Extraction.
2.) In the “Receiver” section configure the receiver entries for “FinalStatusEmail”, “UnsupportedAttachmentMail” and “ProcessFailedMail”. These three receivers should be configured one after another, depending on the processing flow, you can have a different email where the final extraction results are received from the ones which will receive a notification that the processing during the extraction failed or the attachment is in unsupported format.
Please check our documentation for detailed configuration options and how you can connect your email server to the Cloud Integration.
Integration Flow Configuration for Document Information Extraction Service
In this step we configure the Document Information Extraction Service for the integration flow in integration package for Document Information Extraction service.
1.) In the “Receiver” section configure the OAuth_Server:
- Input Address as url from the uaa section of the Document Information Extraction service key JSON file.
- Input Query grant_type=client_credentials
- Input Credential Name with DOX_USER, the credentials name created.
2.) In the “More” section configure the Parameters:
- Input Client ID as the client ID you would like to use from the Document Information Extraction service. If you have not created a client in the Document Information Extraction service yet, you can create one by using the client API of Document Information Extraction.
- Input Document Type as the document type you would like to process. Please check the supported document types that Document Information Extraction can process.
- Input DOX Service URL as url from the Document Information Extraction service key JSON file and add “/document-information-extraction/v1“ at the end.
Integration Flow Deployment
After configuration of the integration package the last step is to deploy the integration flow in integration package for Document Information Extraction service.
After the integration flow is started you can send an email to the configured email inbox in Sender part. The extracted results will come back to you.
This blog post shows how easy one can consume and combine the SAP Cloud Integration with Document Information Extraction Service as a basis to automatically process received documents from an enterprise email inbox.