Microsoft Search Chat Message
About
Microsoft Search Chat Message backend uses the Graph API search chat messages in a channel or individual chat.
Limitations
The following are limitations for the Microsoft Search Chat Messages backend. If a feature is not supported by the Microsoft Search Graph API, it will also be not supported by a Microsoft Search Graph backend. For more information, refer to the Microsoft Graph API documentation.
-
Refiners are not supported by the Microsoft Search Chat Message Backend
- If you are upgrading from an older version of SmartHub, the Microsoft Search backends must be removed and re-added. For more information on upgrading, see How to Upgrade SmartHub.
Set Azure Active Directory Authentication
-
Set authentication to Azure Active Directory in SmartHub as described here: Azure Active Directory Authentication.
Client ID Requirements
-
The Client ID specified in Azure Active Directory Authentication above, must belong to an application with the following permissions, set in Azure:
-
Microsoft Graph
-
Chat.Read or Chat.ReadWrite
-
ChannelMessage.Read.All
How to Add the Microsoft Search Chat Message Backend to SmartHub
Use the following instructions to add the Microsoft Search Chat Message backend to SmartHub:
- Navigate to the SmartHub Administration page: http(s)://[web-app-url]/_admin
- Click Add New Backend.
- The Backend Settings dialogue box appears.
- Enter a Backend Name.
- Select the Backend Type "MSSearchChatMessagesBackend"
- Authentication
- Impersonate - true
- Security trims the results using the current user running the search
- Impersonate - false
- Client Id:
- Enter the Application ID from Azure App Registrations.
- Client Secret:
- Enter the Key's value from Azure App Registrations.
- Microsoft Login Endpoint:
- Example: https://login.microsoftonline.com
- Access Token:
- Enter the access token from SmartHub's OAuth page.
-
Refresh Token:
-
Enter the refresh token from SmartHub's OAuth page.
-
To get AccessToken and Refresh token, "Authorize" button must be clicked, but all above fields must be completed (GraphUrl, ClientId, ClientSecret, MicrosoftLoginEndpoint).
-
- Client Id:
- Impersonate - true
- Click OK.
How to Register an App in Azure and Configure It
If you use SmartHub with Azure Active Directory authentication you can reuse the same App and jump to step 5.
- Navigate to portal.azure.com and log in.
- From the left side menu go to Azure Active Directory > App registrations > New registration.
- On the Register an application window, specify the following:
- Name: Enter the name of the application.
- Application type: Select Web app / API.
- Sign-on URL: Enter the SmartHub's URL.
- Select API Permissions to open the settings menu panel.
- Click Add a Permission.
- Select APIs my organization uses and add the following permissions (as you type the name, it appears):
- Microsoft Graph
Chat.Read or Chat.ReadWrite
ChannelMessage.Read.All
- Microsoft Graph
- Click Certificates & secrets > New client secret to generate a client secret key.
- In the window that appears (shown below) enter the following information.
- Description:
- Enter a name for the client secret.
- Note: The name is your client secret
- Expires: Select the period until expires.
- A Value is generated after you click Add.
- Description:
Metadata
In order to use the properties received from Microsoft Graph, properties are flattened. BA Insight does this because Microsoft Graph API returns properties in this format:
"from":{"emailAddress":{"name":"ExampleName","address":"no-reply@examplename.com"}}}}
In this case, if you want to use the address property, you need to add this property in SmartHub: from.emailAddress.address. Microsoft calls this type of property "recipient" as it contains information about the user sending the email. If the property from the Microsoft Graph API returns a collection of recipient's, the values for the specific property in SmartHub will be returned as a string with ";" used as a delimiter.
The format for Recipient collection must be the same as above: propertyName.emailAddress.name / propertyName.emailAddress.address. For more information on all the properties for the chatMessage resource type from Microsoft Graph, see chatMessage resource type in the Microsoft documentation
The following metadata is available for your results:
-
@data.type
-
id
-
createdDateTime
-
lastModifiedDateTime
-
subject
-
importance
-
webLink
-
from.emailAddress.address
-
from.emailAddress.name
-
channelIdentity.channelId
-
etag
-
chatId