Skip to content

Commit faec2a0

Browse files
committed
added bot identifier for js
1 parent 048565e commit faec2a0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,36 @@ const phoneNumber = { phoneNumber: "+112345556789" };
6969

7070
[PhoneNumberIdentifier](/javascript/api/@azure/communication-common/phonenumberidentifier)
7171

72+
### Microsoft Bot Identifier
73+
74+
> [!NOTE]
75+
> 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/).
76+
77+
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).
78+
79+
#### Basic usage
80+
81+
```javascript
82+
// get the Microsoft bot's ID from Graph APIs
83+
const users = await graphClient.api("/users")
84+
.filter(filterConditions)
85+
.select('displayName,id')
86+
.get();
87+
//here we assume that you have a function getBotFromUsers that gets the bot from the returned response
88+
const bot = getBotFromUsers(users);
89+
// create an identifier
90+
const botIdentifier = { botId: bot.id};
91+
92+
// if you're not operating in the public cloud, you must also pass the right Cloud type.
93+
// You can also specify tenantized bots by setting the isResourceAccountConfigured flag to true.
94+
// The flag is false if the bot is global and no resource account is configured.
95+
const gcchBotIdentifier = { botId: id, cloud: "gcch", isResourceAccountConfigured: true};
96+
```
97+
98+
#### API reference
99+
100+
[MicrosoftBotIdentifier](/javascript/api/@azure/communication-common/microsoftbotidentifier?view=azure-node-preview)
101+
72102
### Unknown
73103

74104
The `UnknownIdentifier` interface 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)