Skip to content

Commit df09eb2

Browse files
authored
Update identifiers-net.md
1 parent d41529d commit df09eb2

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,40 @@ var gcchTeamsAppIdentifier = new MicrosoftTeamsAppIdentifier(bot.Id, Communicati
9999

100100
[MicrosoftTeamsAppIdentifier](/dotnet/api/azure.communication.microsoftteamsappidentifier)
101101

102+
### Teams Extension user
103+
104+
The `TeamsExtensionUserIdentifier` interface represents a Teams user enabled for Teams Phone Extensibility. A `TeamsExtensionUserIdentifier` requires the Microsoft Entra user object ID of the Teams user, the Microsoft Entra tenant ID where the user resides and the Azure Communication Services resource ID. You can retrieve the Microsoft Entra user object ID via the [Microsoft Graph REST API /users](/graph/api/user-get) endpoint from the `id` property in the response and the Microsoft Entra tenant ID via the [Microsoft Graph REST API /organization](/graph/api/organization-get) endpoint from the `id` property in the response. For more information about working with Microsoft Graph, see [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).
105+
Alternatively, you can find the object ID as the `oid` claim and the tenant ID as the `tid` claim in an [Microsoft Entra token](/entra/identity-platform/id-token-claims-reference#payload-claims) or [Microsoft Entra access token](/entra/identity-platform/access-token-claims-reference#payload-claims) after your user signed in and acquired a token.
106+
107+
#### Basic usage
108+
109+
```csharp
110+
// get the Teams user's ID from Graph APIs if only the email is known
111+
var user = await graphClient.Users["[email protected]"]
112+
.Request()
113+
.GetAsync();
114+
115+
// Get the tenantId from Graph API
116+
var organization = await graphClient.Organization
117+
.Request()
118+
.GetAsync();
119+
120+
string tenantId = organization.CurrentPage.FirstOrDefault()?.Id;
121+
122+
//Communication Services Resource ID
123+
var resourceId = "<resource-id-guid>";
124+
125+
// create an identifier
126+
var teamsExtensionUser = new TeamsExtensionUserIdentifier(user.Id, tenantId, resourceId);
127+
128+
// if you're not operating in the public cloud, you must also pass the right Cloud type.
129+
var gcchTeamsExtensionUser = new TeamsExtensionUserIdentifier(userId: user.Id, tenantId: tenantId, resourceId: resourceId, cloud: CommunicationCloudEnvironment.Gcch);
130+
```
131+
132+
#### API reference
133+
134+
[MicrosoftTeamsUserIdentifier](/dotnet/api/azure.communication.teamsextensionuseridentifier)
135+
102136
### Unknown
103137

104138
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 is recently introduced. Any unknown identifier from the service deserializes to `UnknownIdentifier` in the SDK.

0 commit comments

Comments
 (0)