Skip to content

Commit 752c907

Browse files
committed
added bot identifier for java
1 parent bf86735 commit 752c907

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

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

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The `MicrosoftTeamsUserIdentifier` represents a Teams user with its Azure AD use
4141

4242
```java
4343
// get the Teams user's ID from Graph APIs if only the email is known
44-
var user = await graphClient.users("[email protected]")
44+
var user = graphClient.users("[email protected]")
4545
.buildRequest()
4646
.get();
4747

@@ -71,6 +71,39 @@ var phoneNumber = new PhoneNumberIdentifier("+112345556789");
7171

7272
[PhoneNumberIdentifier](/java/api/com.azure.communication.common.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+
```java
84+
// get the Microsoft bot's ID from Graph APIs
85+
var user = graphClient.users()
86+
.buildRequest()
87+
.filter(filterConditions)
88+
.select("displayName,id")
89+
.get();
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](/java/api/com.azure.communication.common.microsoftbotidentifier?view=azure-java-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)