Help Center

Third-party software Contact us

Email server configuration using API

DataSecurity Plus provides options to configure mail servers via SMTP or API. This document details the steps to configure mail servers using API.

Prerequisites for API mail server configuration

You need details of your mail provider to successfully complete email server configuration using the API method. Follow the steps below to find the relevant mail provider details for Microsoft and Google.

Find the Tenant ID, Client ID, and Client Secret for Microsoft

  • Go to the Azure portal, and sign in using your Microsoft account.
  • Select Azure Active Directory from the Azure services section.
  • Go to App registrations > + New registrations to open the Register an application window.
  • Enter the application name, e.g., DataSecurity Plus, and select the default Supported account types.
  • In the left pane, go to Manage > API Permissions > + Add a Permission.
  • Select Microsoft Graph. Click Application permissions as the type of permission required.
  • Select Mail > Mail.Send. Click Add Permissions.
  • Select Grant admin consent.
  • Find and copy the values of the Client ID and Tenant ID in Overview tab in left pane.
  • In the left pane, go to Manage > Certificates & secrets.
  • Click + New client secret.
  • Enter an appropriate description. Choose 24 Months as the expiration date; this is the maximum value that can be used.
  • Click Add.
  • Copy the value (e.g., "14uClLxkHtIVGR3wkCq12341Nd5VtestkkWTyIPrrE=").
  • To continue configuring, follow the steps to set up API configuration

Find the JSON private key for Google

To find the mail provider details for Google, you need to complete these steps:

Find the JSON private key

  • Go to and log in to your Google account.
  • Navigate to the Services accounts page.
  • Click the Select a project drop-down and click New project.
  • Click + Create service account. In the Service account details window, type in the Service account name, Service account ID, and a Service account description for the service account. Click Create and continue.
  • Click Grant this service account to project to select the IAM roles required for the service account.
  • Select Continue.
  • Add the users and groups you want to grant access to and manage the service account.
  • Click Done.
  • Select the email address of the service account created.
  • In the Keys tab, select Create new key from the Add key drop-down.
  • Select JSON as the key type.
  • Click Create.
Note: The JSON private key will be generated and downloaded to your local system. A new private key will be generated each time, so once generated, it is vital to keep the key secure.

Enable the Gmail API service

Provide domain-wide authority to the service account

  • Log in to the Google Workspace admin console as a super administrator.
  • Go to Main menu > Security > Access and data control > API Controls.
  • Under the Domain wide delegation pane, choose Manage Domain Wide Delegation.
  • Click Add new.
  • Type in your service account's Client ID from this page.
  • In the OAuth scopes (comma-delimited) field, select the scopes to which your application needs access. If it needs domain-wide access to the Google mail API, then type in
  • Click Authorize.

The application now has the authority to make API calls as users within your domain.

Set up API configuration

To configure the email server using API:

  • Select Admin Console from the application drop-down.
  • Go to Administrative Settings > Email Settings.
  • Select API for the Mode.
  • Select the Mail Provider.
  • Specify the email address from which you would like to send all DataSecurity Plus notifications in the From Address field.
  • Enter an email address to receive a test email.
  • Specify the mail provider details. Provide the following details if you use:
    • Microsoft as your mail provider: Enter the Tenant ID, Client ID, Client Secret, and Azure Environment that you gathered during the prerequisite steps.
    • Google as your mail provider: Enter the JSON Private Key that you downloaded during the prerequisite steps.
  • Enable Send Emails in HTML Format if you wish to view all DataSecurity Plus notification content in a tabularized manner.
  • Click Save Settings.

Don't see what you're looking for?

  • Visit our community

    Post your questions in the forum.

  • Request additional resources

    Send us your requirements.