Importing images using Microsoft Graph Mail API

ABBYY FlexiCapture 12 lets you automatically import and process document images from your e-mail via the Microsoft Graph Mail API. To be able to do so, you need to create an appropriate image import profile. For more information, see Image import profiles.

To access your e-mail, an application called FlexiCapture 12 Graph Mail Import is used. To finish setting up your import profile, log in to your Microsoft account and grant the following permissions to the FlexiCapture 12 Graph Mail Import application:

  • Maintain access to data you have given it access to
  • Sign you in and read your profile
  • Read your mail
  • Read and write access to your mail
  • Read and write mail you can access

Permission identifiers:

Mail permissions:

Mail.Read

Mail.ReadWrite

Mail.ReadWrite.Shared

OpenID permissions:

email

offline_access

openid

profile

User permissions: User.Read

For more information about permissions, visit the official Microsoft website (https://docs.microsoft.com/en-us/graph/permissions-reference/).

Note: You cannot change the e-mail import application or modify the permissions granted to it.

Depending on your security settings, one of the following will happen on your first authorization attempt:

  • Access will be granted.
  • Permission from the administrator will be required before you are granted access (for more information, see the official Microsoft website).

OAuth 2.0 authorization

To set up image import via the Microsoft Graph Mail API, OAuth 2.0 authorization is required. For more information about the authorization process, see the official Microsoft website and section 4.1 of the OAuth 2.0 Framework.

Once authorized, you will be automatically directed to https://go.abbyy.com/oauth2redirect, which will further redirect you to https://127.0.0.1. If the authorization is successful, you can navigate back to the authorization wizard and continue setting up the import profile.

Note: Sometimes, after confirmation of authorization is received, the authentication is denied with the following error message: Flow failed. Failure info/error: Connect to token endpoint failed (for more information, see Microsoft Graph API connection error).

Note: Redirection to https://go.abbyy.com/oauth2redirect is required in order to make use of the HTTPS protocol (for more information, please see the official Microsoft website). This step is completely safe: data collection is disabled at https://go.abbyy.com/oauth2redirect, and no other actions are performed.

During the import, the primary refresh token is replaced with secondary access and refresh tokens, which are used for authorization and to access your e-mail via the Microsoft Graph Mail API. Administrator permissions are nor required, as access is provided only to a specific user or a specific mail box.

Note: By default, the refresh token required to use the Microsoft Graph Mail API will expire after 90 days of inactivity and you will need to re-authenticate to obtain a new token. The token lifetime can be configured by an Active Directory administrator (see Microsoft documentation for details).

Note: When setting up an import profile on the Project Setup Station, connection to the mail box will be established by the computer where the Project Setup Station is opened. For automatic import tasks, connection to the mail box will be established by Processing Station computers.

12.04.2024 18:16:02

Please leave your feedback about this article

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.