# Microsoft Graph Api · Accounts · Email · Admin Portal

Register a Microsoft Entra application, grant mail permissions and connect a mailbox through Microsoft Graph API.

Canonical: https://docs.mintsd.com/docs/mint-service-desk/admin-portal-microsoft-graph-api
Language: en-GB
Revision: 2a2d39f1e31deba465d9905cd685a5a3416966a588eb6151bba19ba5bc3c7cc9

<a id="element-01a1452e-14b6-7635-bbeb-957acc50d58b"></a>

Open the Microsoft Graph API mailbox configuration form.

<a id="element-01a1452e-14b6-74e2-9206-336e6f484ee8"></a>

![Microsoft Graph Api: Open the Microsoft Graph API mailbox configuration form.](https://docs.mintsd.com/api/reader/assets/assets/images/image946.png?v=22df1105b52f6bdc1c9038afd5f610c7013f8852200b9577961e39ca4bc4bbdc)

<a id="element-01a1452e-14b7-71e7-a40d-52fcc0576ae9"></a>

## Registering the application

First go to <https://portal.azure.com>
Sign in and go to **Microsoft Entra ID** services.

<a id="element-01a1452e-14b7-7a1a-b45e-455c145f0ab7"></a>

![Microsoft Graph Api: First go to https://portal.azure.com Sign in and go to Microsoft Entra ID services.](https://docs.mintsd.com/api/reader/assets/assets/images/image816.png?v=60bd21eb63059543d8cddb7251ce32f7b58c2163e58ce637a90f1305dd587e28)

<a id="element-01a1452e-14b8-77ee-a60b-7006615ed66d"></a>

Go to “App” and ‘App registration’

<a id="element-01a1452e-14b8-7378-9b87-6bb338fbf9a7"></a>

![Microsoft Graph Api: Go to “App” and ‘App registration’.](https://docs.mintsd.com/api/reader/assets/assets/images/image945.png?v=08c40f870cce2c76dded71a286c24cfde0c9a588b13c615fb1f6105b357a45a2)

<a id="element-01a1452e-14ba-7ce1-978c-f1c06240a7d3"></a>

The following form will appear.

<a id="element-01a1452e-14ba-776e-a9db-3848c0593e40"></a>

![Microsoft Graph Api: The following form will appear.](https://docs.mintsd.com/api/reader/assets/assets/images/image817.jpg?v=3ca9c2bb044d3bffe633800a103f86b166f6fb8d798591d1a0f51bca57fa1063)

<a id="element-01a1452e-14bb-7771-bb8b-03a00894f866"></a>

Complete the registration form:

<a id="element-01a1452e-14bc-754c-8048-0994e177cd9a"></a>

- in ‘Name’ field type your preferred name
- ‘Supported Account Types’: leave it as it is
- ‘Redirect URL’: Select “Web” option.

<a id="element-01a1452e-14bc-7852-9816-c093cabe73e1"></a>

Copy Application (client) ID and Directory (tenant) ID

<a id="element-01a1452e-14bc-7f97-909c-0dcc7a983f85"></a>

![Microsoft Graph Api: Copy Application (client) ID and Directory (tenant) ID.](https://docs.mintsd.com/api/reader/assets/assets/images/image951.png?v=620d8214e398a4e3f57daf2d3513b79445fe8b771e8c858d6808edb13648410b)

<a id="element-01a1452e-14bd-7262-87a6-f99fc4c756f1"></a>

Paste them here:

<a id="element-01a1452e-14bd-72f7-9a54-1ce3c717b925"></a>

![Microsoft Graph Api: Paste them here:](https://docs.mintsd.com/api/reader/assets/assets/images/image952.png?v=9894a09d31ac660a4ffcaf2af7b6a1d8499c9f95afcf5197a2181a80490ec297)

<a id="element-01a1452e-14be-7690-a63a-582d6697699c"></a>

## API permissions

After the registration go to the **Manage > API permissions** located in the sidebar on the left.

<a id="element-01a1452e-14be-741f-adf0-3371b5221675"></a>

<a id="element-01a1452e-14bf-7a81-9168-192a42c7b056"></a>

Press the ![Add a permission](https://docs.mintsd.com/api/reader/assets/assets/images/image947.png?v=4b053d492fe80fba480deec0c5e0e285a09521edeb2022a584e9fddba2f5a629#element-01a1452e-14be-741f-adf0-3371b5221675) button. Then, from the window that slides out on the right side of the screen, select the “Microsoft Graph” option.

<a id="element-01a1452e-14bf-7ba5-916d-6a60d8cd44ba"></a>

![Press the button. Then, from the window that slides out on the right side of the screen, select the “Microsoft Graph” option.](https://docs.mintsd.com/api/reader/assets/assets/images/image906.jpg?v=d3062642bdb5061be3925d1950067807d2db7b30480856bfbac3c554ac21cf07)

<a id="element-01a1452e-14c0-7446-a704-30755abc3e34"></a>

From the two available options, select the one on the right - Application permissions

<a id="element-01a1452e-14c0-7691-8ffa-7c19290e9b42"></a>

![Microsoft Graph Api: From the two available options, select the one on the right - Application permissions.](https://docs.mintsd.com/api/reader/assets/assets/images/image948.png?v=18b8ef7a247b72c8bae5077a3076123854ee07d15d55d7b2802d630ab3fa1455)

<a id="element-01a1452e-14c1-7d2a-a6db-04fd8e85e42f"></a>

In the Mail section, select the following options:

<a id="element-01a1452e-14c1-718c-97d9-7d86d9f609ea"></a>

![Microsoft Graph Api: In the Mail section, select the following options:](https://docs.mintsd.com/api/reader/assets/assets/images/image1355.png?v=a15293cf95823ad737dc6d2d34ea8b5ea6b727160ee07a22ed53599758b6590b)

<a id="element-01a1452e-14c2-78cb-886e-22692811ad98"></a>

<a id="element-01a1452e-14c2-7585-b982-07f48781c7a6"></a>

To save the rights, press the ![Add permissions](https://docs.mintsd.com/api/reader/assets/assets/images/image950.png?v=0bb1ee8c51f6ee2341b3f776b6240b2c6f720e0f0c2d091a3ab0d188fe4aee6a#element-01a1452e-14c2-78cb-886e-22692811ad98) button.

<a id="element-01a1452e-14c2-749b-8a43-07f6c3432c75"></a>

You may see a request for administrator approval:

<a id="element-01a1452e-14c3-71af-aef7-2007ca870482"></a>

![Microsoft Graph Api: You may see a request for administrator approval:](https://docs.mintsd.com/api/reader/assets/assets/images/image959.png?v=84256dd9835a69880b02609bc37a71933ae461c96e5110784efacfd2c1af46c2)

<a id="element-01a1452e-14c3-7fd6-9280-ff3cafe10718"></a>

Domain administrator approval is required to grant permissions (read, write, send). It is recommended that domain administrators
narrow Graph application access to only the required email addresses. By default, permissions will be granted to the entire domain
(for each email address in the domain).

<a id="element-01a1452e-14c4-70bd-bb81-2befb1c64e9f"></a>

## Application access policy

To configure an application access policy and limit the scope of application permissions:

<a id="element-01a1452e-14c4-730d-9190-e149d6f2f343"></a>

Connect to Exchange Online PowerShell:

<a id="element-01a1452e-14c5-7c96-bb03-92a40d80a189"></a>

- To require all PowerShell scripts that you download from the internet are signed by a trusted publisher, run the following command in an elevated Windows PowerShell window (a WindowsPowerShell window you open by selecting Run as administrator)

<a id="element-01a1452e-14c5-7cd4-8202-f3066f3929d6"></a>

**Set-ExecutionPolicy RemoteSigned**

<a id="element-01a1452e-14c6-702a-9320-c3dbbda6a38c"></a>

- Install ‘ExchangeOnlineManagement’ tool for managing the Exchange Online Services

<a id="element-01a1452e-14c6-729e-8a8b-9cb833340b1c"></a>

**Install-Module -Name ExchangeOnlineManagement**

<a id="element-01a1452e-14c6-7b88-884a-a92fc4b16dac"></a>

![Microsoft Graph Api: Install-Module -Name ExchangeOnlineManagement.](https://docs.mintsd.com/api/reader/assets/assets/images/image970.png?v=d4d97b5401835ea065c53756b555871caeddd77c7f8a6734d43f9542472c5d6a)

<a id="element-01a1452e-14c7-7313-b287-0940981a79ae"></a>

- Login to the Exchange Online Powershell (a login pop-up will prompt out)

<a id="element-01a1452e-14c7-71f2-9500-21d6f7bfb8cb"></a>

**Connect-ExchangeOnline -UserPrincipalName {your-admin-account@your-domain.com}**

<a id="element-01a1452e-14c8-7d40-8720-e3c02773ee44"></a>

![Microsoft Graph Api: Connect-ExchangeOnline -UserPrincipalName {your-admin-account@your-domain.com}.](https://docs.mintsd.com/api/reader/assets/assets/images/image971.png?v=6d9553076c204dbf9389450524e0e7dfd5c6a087a5e7b6aab7889708ec6fe2dd)

<a id="element-01a1452e-14c9-7f11-8669-8bb40577ece1"></a>

Identify the app’s client ID and a mail-enabled security group to restrict the app’s access to.
Identify the app’s application (client) ID in the Azure app registration portal.
Create a new mail-enabled security group or use an existing one and identify the email address for
the group:

<a id="element-01a1452e-14ca-7ec6-96ac-73240f13ca77"></a>

- You must have Microsoft 365 admin permissions to access the Exchange admin center. For more information, see Permissions in Exchange Online.
- sign in to Microsoft 365 or Office 365 using your work or school account, and then choose the Admin tile.
- In the Microsoft 365 admin center, choose Admin centers > Exchange.
- In the EAC, navigate to Recipients > Groups.
- Click New > Security groups and fill all necessary fields.

<a id="element-01a1452e-14cb-71b8-8993-f18683212425"></a>

Create an application access policy.

<a id="element-01a1452e-14cc-7915-b7b7-885c5d7a3519"></a>

- Run the following command, replacing the AppId, PolicyScopeGroupId, and Description arguments
- New-ApplicationAccessPolicy -AppId e7e4dbfc-046f-4074-9b3b 2ae8f144f59b -PolicyScopeGroupId [EvenUsers@contoso.com](mailto:EvenUsers%40contoso.com) -AccessRight RestrictAccess -Description “Restrict this app to members of distribution group EvenUsers.”

<a id="element-01a1452e-14cd-745d-ab03-9ddcb2f4904c"></a>

**Note:** Changes to application access policies can take more than 1 hour to take effect in Microsoft Graph REST API calls.

<a id="element-01a1452e-14cd-7f2a-ac57-a1422d0adc4c"></a>

## Client secret and saving

Then go to the **Certificates & secrets** section.

<a id="element-01a1452e-14ce-7a79-8d35-ae75678a22ff"></a>

<a id="element-01a1452e-14ce-754d-be50-9d91e22a3e3c"></a>

Once you are in this section press the ![New client secret](https://docs.mintsd.com/api/reader/assets/assets/images/image953.png?v=679d802bf217d16e1abbe5d1d17405f6d69f33860a7410fbbfbd6065bbff558f#element-01a1452e-14ce-7a79-8d35-ae75678a22ff) button.

<a id="element-01a1452e-14cf-77c3-aba2-37c5bcde3881"></a>

Enter a recognisable name in **Description**. In **Expires**, keep the default of 6 months or choose another validity period.

<a id="element-01a1452e-14cf-7fa2-b961-f0694268022b"></a>

![Enter a recognisable name in Description. In Expires, keep the default of 6 months or choose another validity period.](https://docs.mintsd.com/api/reader/assets/assets/images/image954.png?v=daed15f5dc91dc698b74b17958c36a4d68bcd47075c7891ada6863a8a9daace7)

<a id="element-01a1452e-14d0-7a30-9ffc-a309b4747fdd"></a>

<a id="element-01a1452e-14d0-75f3-9e7c-4a5286607a22"></a>

To approve the operation press the ![Add](https://docs.mintsd.com/api/reader/assets/assets/images/image955.png?v=08e95fde32fe902900c6fe21ddd248b4d98be129abf8ee81fe1f046281ec474f#element-01a1452e-14d0-7a30-9ffc-a309b4747fdd) button.

<a id="element-01a1452e-14d1-796c-800b-dc566f3e2c34"></a>

After saving, copy **Value**.

<a id="element-01a1452e-14d1-7bf2-8e2d-18d2e8708dc2"></a>

![Microsoft Graph Api: After saving, copy Value .](https://docs.mintsd.com/api/reader/assets/assets/images/image956.png?v=7201a08ebfa949c555d8a8b0d5c72b1bd23b037c5f308487658ed8c6e90b24cb)

<a id="element-01a1452e-14d2-7d52-af9b-ebc918dcb4e9"></a>

**Client secret values cannot be viewed, except for immediately after creation. Be sure to save the secret when created before leaving the page.**

<a id="element-01a1452e-14d2-7afd-83b2-3605bbe7a9cb"></a>

Paste the copied value into MINT in the **Client secret** section

<a id="element-01a1452e-14d2-77b4-a025-97972fcda2b1"></a>

![Microsoft Graph Api: Paste the copied value into MINT in the Client secret section.](https://docs.mintsd.com/api/reader/assets/assets/images/image957.png?v=b49698938dfedf24a2b103319d426603c568f5a49dc3ad470c6acc1ec1a6b2c6)

<a id="element-01a1452e-14d3-70ed-8f58-3d6e281c357f"></a>

The configuration should look similar to this:

<a id="element-01a1452e-14d3-7816-8d85-2ccf06ceba3b"></a>

![Microsoft Graph Api: The configuration should look similar to this:](https://docs.mintsd.com/api/reader/assets/assets/images/image958.png?v=c706471be424f44689ac50cb35436a47c48c5cc15e4325df91fd93c843873e67)

<a id="element-01a1452e-14d4-7c49-8d16-f3a8108069fc"></a>

<a id="element-01a1452e-14d4-7733-bfb3-315a241b6967"></a>

To save the mailbox configuration press the ![Save](https://docs.mintsd.com/api/reader/assets/assets/images/image8.png?v=c6dfcae62b1da5a56376cb98f40e0a593d8d731e458977d27180f6380454b49d#element-01a1452e-14d4-7c49-8d16-f3a8108069fc) button.

