# Microsoft Office365 AAD

iX Hello supports Integration with Microsoft Office Azure Active Directory and also supports few AAD Managed APIs.

1. Microsoft Office365 Configuration in iX Hello

Make sure that you follow [this](https://docs.ixhello.com/ixhc/connections/microsoft-office365-integration-guide) document to configure Office365 configuration in iX Hello.

At this point, you should have successfully connected integration with Microsoft Office365 AAD. To confirm, you can navigate to Integration > Connect System. You shall have a connection of type Office365 AAD there as shown below:

![](https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FjTyTbfymHxhLK9PepHU2%2F0?alt=media)

If not, you shall go through Step 1 again and confirm that all the steps have been followed thoroughly.

### Create Custom App:

1. Go to Custom Apps > Manage Apps in left navigation and click on Create New App. Provide the following details to create an app.

| Name: Azure AAD Demo    |
| ----------------------- |
| Custom App Type: Search |
| Category: Default       |

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FMuECo0Yrdnw1utpQi9tK%2Fimage.png?alt=media&#x26;token=ce0097f9-bff6-4a26-9ab2-87bc1d8ee5a7" alt="" width="527"><figcaption></figcaption></figure>

2. Press Save
3. The next step is to prepare data source for the App. Select the newly created App and go to the Data Source tab. Click on Create New Data Source and fill in the following details:

| Name: Amazon AAD DS                                                                                                                 |
| ----------------------------------------------------------------------------------------------------------------------------------- |
| Integration Configuration: Microsoft Office365AAD (make sure to select the integration created in at the beginning of the document) |

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2F0DU0S1JcbFVaJaLH1m3h%2Fimage.png?alt=media&#x26;token=8162998e-7a94-4c80-90f0-2d136be66486" alt="" width="532"><figcaption></figcaption></figure>

4. Press Save. The next step is to create methods.

### Create Methods:

At the time of this document, iX Hello supports 3 managed functionalities:

* GetUsersInOrganization
* GetGroupsInOrganization
* GetUsersInADepartment

For this document, we are implementing the GetUsersInOrganization method.

Click on Create New Method and fill in following details:

| Name: GetUsersInOrganization                                                                        |
| --------------------------------------------------------------------------------------------------- |
| RequestType: GetUsersInOrganization                                                                 |
| Parameters: No Parameters                                                                           |
| Result Type: ListOfRecords                                                                          |
| Record Limit: 10                                                                                    |
| Record JsonPath: $.value\[\*]                                                                       |
| Valid Result Template: Here are the users in the organization: {{Records}} How else can I help you? |
| Record Template: {{mail}}                                                                           |
| Empty Result Template: Sorry, no user found in the organization. How else can I help you?           |

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2F9QMJU1eyBUoiWJ8I5cqG%2Fimage.png?alt=media&#x26;token=23680f0c-1927-4a28-a2ca-e79f8672518c" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FuuUCmq4USZXiZLpRsYEc%2Fimage.png?alt=media&#x26;token=05527095-8ead-4f81-9810-e3a8fa2f28fe" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FX0mzE7sGyKHDgEdykSri%2Fimage.png?alt=media&#x26;token=01560460-9807-43a3-a69a-731dd4504e65" alt="" width="563"><figcaption></figcaption></figure>

After you’ve created the method, you can save and test it. You shall expect the following output..

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FEiWcMTXHKxjkedIEPjnZ%2Fimage.png?alt=media&#x26;token=4ee63d40-7984-43e2-84d9-2f9c536788ee" alt="" width="563"><figcaption></figcaption></figure>

If you have not received the output as shown above, there is some issue with your app building. You need to revise the steps that you have completed.

1. Go to the Intents tab and click on Create New Intent.

| Name: GetUsersInOrganizationIntent        |
| ----------------------------------------- |
| Intent Type: Search                       |
| Intent Action: Execute Method             |
| Data Source: Amazon AAD DS                |
| Data Source Method:GetUsersInOrganization |

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FHbN2ACoBYwlcPvPtKXPc%2Fimage.png?alt=media&#x26;token=0af99057-ff05-4a9d-b0cd-df320143b545" alt="" width="527"><figcaption></figcaption></figure>

2. Save.
3. Create Utterances in the Utterance tab. Utterances are short keywords used to invoke the intent.

| Value: list all users          |
| ------------------------------ |
| Custom App: Azure AAD Demo     |
| Intent: GetUsersInOrganization |

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FMbPBPr3MDNM3Gn0LBuqR%2Fimage.png?alt=media&#x26;token=3d928d34-8cbb-4602-8322-1d3e56fc40ba" alt="" width="530"><figcaption></figcaption></figure>

4. Press Save.
5. The next step is to create Input corresponding to the Intent. Go to Input tab, click on Create New Input and provide following details in the resulting screen.

| Name: GetUsersInOrganizationInput           |
| ------------------------------------------- |
| Custom App: Azure AAD Demo                  |
| Custom Intent: GetUsersInOrganizationIntent |
| Data Source: Amazon AAD DS                  |
| Data Source Method: GetUsersInOrganization  |

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FkBfKTrPPs9sxGsbC72Lp%2Fimage.png?alt=media&#x26;token=25859277-e0a7-4a22-bc6a-b6b8aa2ad2d5" alt="" width="529"><figcaption></figcaption></figure>

6. Press Save

## **Publish to Amazon Lex**

1. To publish to Amazon Lex, select “**Publish**” in the top menu tabs then click “**Add App Publishing**”. Then input or select the following:

| External App Name: Azure AD Demo                                 |
| ---------------------------------------------------------------- |
| App Type: Search                                                 |
| Channel: Amazon Lex                                              |
| Skill Invocation: active directory Demo                          |
| Welcome Messages: Welcome to Azure AAD Demo. How can I help you? |
| Auto Publish: Checked                                            |

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FdCvWfGmvDrwO8QjIRXAW%2Fimage.png?alt=media&#x26;token=18e0dfb8-a624-4132-85e3-1ee44deadab8" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FqOUdcasKQPM4Iw06eRbS%2Fimage.png?alt=media&#x26;token=542fe9ea-df3e-4122-b400-2170023eebd3" alt="" width="563"><figcaption></figcaption></figure>

2. Press Publish
3. Select the Lex account and click on Publish to Amazon Lex

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FpvjZufRFH81qufG77JT2%2Fimage.png?alt=media&#x26;token=b3b30779-51d6-480c-a11d-21bbf27bae8c" alt="" width="563"><figcaption></figcaption></figure>

4. On the resulting screen, ensure that a success message shows for the publishing steps before clicking “**Test Lex**”. If a success message not shown, click “**Go Back to App Publishing**” to fix any issue shown in publishing result.

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FeVeWzhi8D1I462gdAV5Q%2Fimage.png?alt=media&#x26;token=69c40fd7-6eaa-4bed-9633-3af6b45e847e" alt="" width="563"><figcaption></figcaption></figure>

5. Once clicked on "**Test Lex Bot**", you will be redirected to App Publishing screen, and the Test Bot will appear at the right corner showing the App name along with the welcome message:

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FcmvoWtWLNfcLvBxzzpQy%2Fimage.png?alt=media&#x26;token=a1c22a6d-07a4-4eb6-8e1b-431fa80ad13b" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2Flr4RHxZOVwbtDdQU2WXV%2Fimage.png?alt=media&#x26;token=24a94303-2c13-4d9e-9c84-9f8a3f7c8120" alt="" width="563"><figcaption></figcaption></figure>

Congratulation!!! You have successfully completed iX Hello integration with Microsoft Office365 Azure AAD.
