Skip to content

Commit 896ff96

Browse files
authored
Update identifiers-python.md
1 parent b685b23 commit 896ff96

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,35 @@ gcch_teams_app_identifier = MicrosoftTeamsAppIdentifier(
9696

9797
[MicrosoftTeamsAppIdentifier](/python/api/azure-communication-identity/azure.communication.identity.microsoftteamsappidentifier)
9898

99+
### Teams Extension user
100+
101+
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).
102+
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.
103+
104+
105+
#### Basic usage
106+
107+
```python
108+
# get the Teams user's ID from Graph APIs if only the email is known
109+
user_id = graph_client.get("/users/[email protected]").json().get("id");
110+
111+
# get the tenantId from Graph API
112+
tenant_id = graph_client.get("/organization").json()["value"][0]["id"]
113+
114+
# Communication Services Resource ID
115+
resourceId = "<resource-id-guid>"
116+
117+
# create an identifier
118+
teams_user = TeamsExtensionUserIdentifier(user_id, tenant_id, resource_id)
119+
120+
# if you're not operating in the public cloud, you must also pass the right Cloud type.
121+
gcch_teams_user = TeamsExtensionUserIdentifier(user_id, tenant_id, resource_id, cloud=CommunicationCloudEnvironment.GCCH)
122+
```
123+
124+
#### API reference
125+
126+
TO DO!!!!!!!!!!!!!!
127+
99128
### Unknown
100129

101130
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 the `UnknownIdentifier` in the SDK.

0 commit comments

Comments
 (0)