Skip to content

Commit 55b2774

Browse files
Apply suggestions from code review
Co-authored-by: Dominik <[email protected]>
1 parent 96b25d9 commit 55b2774

File tree

3 files changed

+18
-21
lines changed

3 files changed

+18
-21
lines changed

articles/communication-services/concepts/identity-model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Managing a mapping between Azure Communication Services user identities and your
3434
## (Preview) Simplify identity mapping with `customId`
3535

3636
> [!IMPORTANT]
37-
> This feature is available starting with the SDK version `1.4.0-beta1`.
37+
> This feature is available starting with the Identity SDK version `1.4.0-beta1` and REST API version `2025-03-02-preview`.
3838
3939
> [!NOTE]
4040
> This feature is currently in preview.

articles/communication-services/quickstarts/identity/includes/access-tokens/access-token-js.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ You can create an identity with an associated `customId` to map your application
128128

129129
```javascript
130130
const customId = "[email protected]";
131-
let identityResponse = await identityClient.createUser({customId });
132-
console.log(`\nCreated an identity with ID: ${identityResponse.communicationUserId}`);
131+
let user = await identityClient.createUser({ customId });
132+
console.log(`\nCreated an identity with ID: ${user.communicationUserId}`);
133133
```
134134

135135
## (Preview) Get identity details
@@ -144,11 +144,10 @@ You can use the `getUserDetail` method to retrieve information about a user, inc
144144

145145
```javascript
146146
const customId = "[email protected]";
147-
let identityResponse = await identityClient.createUser({customId });
148-
var identity = userResponse.Value;
149-
var userDetails = client.getUserDetail(identity);
150-
console.log(`\nCreated an identity with ID: ${identityResponse.communicationUserId}`);
151-
console.log(`\nCustom id: ${userDetails.customId}`);
147+
let user = await identityClient.createUser({ customId });
148+
var userDetails = client.getUserDetail(user);
149+
console.log(`\nUser ID: ${user.communicationUserId}`);
150+
console.log(`\nCustom ID: ${userDetails.customId}`);
152151
console.log(`\nLast token issued at: ${userDetails.lastTokenIssuedAt}`);
153152
```
154153

articles/communication-services/quickstarts/identity/includes/access-tokens/access-token-net.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,8 @@ Store the received identity with mapping to your application users (for example,
133133
You can create an identity with an associated `customId` to map your application's user identities with Azure Communication Services identities. If you call the `CreateUser` method again with the same `customId`, it will return the same `user.Id`. This eliminates the need to store the mapping yourself.
134134

135135
```csharp
136-
var identityResponse = client.CreateUser(customId: "[email protected]");
137-
var identity = userResponse.Value;
138-
Console.WriteLine($"\nCreated an identity with ID: {identity.Id}");
136+
Response<CommunicationUserIdentifier> user = await client.CreateUserAsync(customId: "[email protected]");
137+
Console.WriteLine($"\nCreated an identity with ID: {user.Id}");
139138
```
140139

141140
## (Preview) Get identity details
@@ -149,12 +148,11 @@ Console.WriteLine($"\nCreated an identity with ID: {identity.Id}");
149148
You can use the `GetUserDetail` method to retrieve information about a user, including the `customId` and the `lastTokenIssuedAt`.
150149

151150
```csharp
152-
var identityResponse = await client.CreateUserAsync(customId: "[email protected]");
153-
var identity = userResponse.Value;
154-
var userDetails = client.GetUserDetail(identity);
155-
Console.WriteLine($"User id: {userDetails.Value.User.Id}");
156-
Console.WriteLine($"Custom id: {userDetails.Value.CustomId}");
157-
Console.WriteLine($"Last token issued at: {userDetails.Value.LastTokenIssuedAt}");
151+
Response<CommunicationUserIdentifier> user = await client.CreateUserAsync(customId: "[email protected]");
152+
var userDetails = client.GetUserDetail(user);
153+
Console.WriteLine($"User ID: {userDetails.Id}");
154+
Console.WriteLine($"Custom ID: {userDetails.CustomId}");
155+
Console.WriteLine($"Last token issued at: {userDetails.LastTokenIssuedAt}");
158156
```
159157

160158
## Issue an access token
@@ -214,12 +212,12 @@ You can pass your custom ID to the `CreateUserAndTokenAsync` method to create an
214212

215213
```csharp
216214
// Issue an identity and an access token with a validity of 24 hours and the "voip" scope for the new identity
217-
var identityAndTokenResponse = await client.CreateUserAndTokenAsync(customId: "[email protected]", scopes: new[] { CommunicationTokenScope.VoIP });
215+
Response<CommunicationUserIdentifierAndToken> identityAndTokenResponse = await client.CreateUserAndTokenAsync(customId: "[email protected]", scopes: new[] { CommunicationTokenScope.VoIP });
218216

219217
// Retrieve the identity, token, and expiration date from the response
220-
var identity = identityAndTokenResponse.Value.User;
221-
var token = identityAndTokenResponse.Value.AccessToken.Token;
222-
var expiresOn = identityAndTokenResponse.Value.AccessToken.ExpiresOn;
218+
var identity = identityAndTokenResponse.User;
219+
var token = identityAndTokenResponse.AccessToken.Token;
220+
var expiresOn = identityAndTokenResponse.AccessToken.ExpiresOn;
223221
Console.WriteLine($"\nCreated an identity with ID: {identity.Id}");
224222
Console.WriteLine($"\nIssued an access token with 'voip' scope that expires at {expiresOn}:");
225223
Console.WriteLine(token);

0 commit comments

Comments
 (0)