Skip to content

Commit 578f207

Browse files
authored
Merge pull request #80952 from gbowerman/patch-1
Fix 'str' object has no attribute 'properties' error
2 parents 9d9b142 + 36fbec5 commit 578f207

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/communication-services/quickstarts/includes/user-access-token-python.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: tomaschladek
66
manager: nmurav
77
ms.service: azure-communication-services
88
ms.subservice: azure-communication-services
9-
ms.date: 06/30/2021
9+
ms.date: 09/13/2021
1010
ms.topic: include
1111
ms.custom: include file
1212
ms.author: tchladek
@@ -104,10 +104,10 @@ Use the `create_user_and_token` method to create a Communication Services identi
104104
```python
105105
# Issue an identity and an access token with the "voip" scope for the new identity
106106
identity_token_result = client.create_user_and_token(["voip"])
107-
identity = identity_token_result[0].properties['id']
107+
identity = identity_token_result[0]
108108
token = identity_token_result[1].token
109109
expires_on = identity_token_result[1].expires_on.strftime("%d/%m/%y %I:%M %S %p")
110-
print("\nCreated an identity with ID: " + identity)
110+
print("\nCreated an identity with ID: " + identity.properties['id'])
111111
print("\nIssued an access token with 'voip' scope that expires at " + expires_on + ":")
112112
print(token)
113113
```
@@ -119,7 +119,7 @@ To refresh an access token, use the `CommunicationUserIdentifier` object to reis
119119
```python
120120
# Value existingIdentity represents identity of Azure Communication Services stored during identity creation
121121
identity = CommunicationUserIdentifier(existingIdentity)
122-
token_result = client.get_token( identity, ["voip"])
122+
token_result = client.get_token(identity, ["voip"])
123123
```
124124

125125
## Revoke access tokens

0 commit comments

Comments
 (0)