Skip to content

Commit abe31e5

Browse files
authored
Update identifiers-android.md
1 parent c5fd0af commit abe31e5

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,39 @@ MicrosoftTeamsAppIdentifier gcchTeamsAppIdentifier = new MicrosoftTeamsAppIdenti
9898

9999
[MicrosoftTeamsAppIdentifier](https://azure.github.io/azure-sdk-for-android/azure-communication-common/com/azure/android/communication/common/MicrosoftTeamsAppIdentifier.html)
100100

101+
### Teams Extension user
102+
103+
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).
104+
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.
105+
106+
#### Basic usage
107+
108+
```java
109+
// get the Teams user's ID from Graph APIs if only the email is known
110+
User user = graphClient.users("[email protected]")
111+
.buildRequest()
112+
.get();
113+
114+
// get the tenantId from Graph API
115+
OrganizationCollectionPage organizations = graphClient.organization()
116+
.buildRequest()
117+
.get();
118+
String tenantId = organizations.getCurrentPage().get(0).id;
119+
120+
// Communication Services Resource ID
121+
var resourceId = "<resource-id-guid>";
122+
123+
// create an identifier
124+
var teamsExtensionUser = new TeamsExtensionUserIdentifier(user.id, tenantId, resourceId);
125+
126+
// if you're not operating in the public cloud, you must also set the right Cloud type.
127+
var gcchTeamsExtensionUser = new TeamsExtensionUserIdentifier(user.id, tenantId, resourceId).setCloudEnvironment(CommunicationCloudEnvironment.GCCH);
128+
```
129+
130+
#### API reference
131+
132+
[MicrosoftTeamsUserIdentifier](https://azure.github.io/azure-sdk-for-android/azure-communication-common/com/azure/android/communication/common/MicrosoftTeamsUserIdentifier.html)
133+
101134
### Unknown
102135

103136
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)