Skip to content

Commit bf86735

Browse files
committed
added bot identifier for .net
1 parent faec2a0 commit bf86735

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

articles/communication-services/concepts/includes/identifiers/identifiers-net.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,39 @@ var phoneNumber = new PhoneNumberIdentifier("+112345556789");
7171

7272
[PhoneNumberIdentifier](/dotnet/api/azure.communication.phonenumberidentifier)
7373

74+
### Microsoft Bot Identifier
75+
76+
> [!NOTE]
77+
> The Microsoft Bot Identifier is currently in public preview. For more information about previews, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
78+
79+
The `MicrosoftBotIdentifier` interface represents a Microsoft bot with its Azure AD bot object ID. In the preview version the interface represents a bot of the Teams Voice applications such as Call Queue and Auto Attendant, and the application should be configured with a resource account. You can retrieve the Azure AD bot object ID via the [Microsoft Graph REST API /users](/graph/api/user-list) endpoint from the `id` property in the response. For more information on how to work with Microsoft Graph, try the [Graph Explorer](https://developer.microsoft.com/en-us/graph/graph-explorer?request=users%2F%7Buser-mail%7D&method=GET&version=v1.0&GraphUrl=https://graph.microsoft.com) and look into the [Graph SDK](/graph/sdks/sdks-overview).
80+
81+
#### Basic usage
82+
83+
```csharp
84+
// get the Microsoft bot's ID from Graph APIs
85+
var users = await graphClient.Users.GetAsync((requestConfiguration) =>
86+
{
87+
requestConfiguration.QueryParameters.Select = new string []{ "displayName","id" };
88+
requestConfiguration.QueryParameters.Filter = filterConditions;
89+
});
90+
91+
//here we assume that you have a function GetBotFromUsers that gets the bot from the returned response
92+
var bot = GetBotFromUsers(users);
93+
94+
// create an identifier
95+
var botIdentifier = new MicrosoftBotIdentifier(bot.Id);
96+
97+
// if you're not operating in the public cloud, you must also pass the right Cloud type.
98+
// You can also specify tenantized bots by setting the isResourceAccountConfigured flag to true.
99+
// The flag is false if the bot is global and no resource account is configured.
100+
var gcchBotIdentifier = new MicrosoftBotIdentifier(bot.Id, true, CommunicationCloudEnvironment.Gcch);
101+
```
102+
103+
#### API reference
104+
105+
[MicrosoftBotIdentifier](/dotnet/api/azure.communication.microsoftbotidentifier?view=azure-dotnet-preview)
106+
74107
### Unknown
75108

76109
The `UnknownIdentifier` exists for future-proofing and you might encounter it when you are on an old version of the SDK and a new identifier type has been introduced recently. Any unknown identifier from the service will be deserialized to the `UnknownIdentifier` in the SDK.

0 commit comments

Comments
 (0)