Skip to content

Commit c5048fb

Browse files
address PR comments
1 parent e778110 commit c5048fb

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

articles/communication-services/concepts/raw-id-use-cases.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ CommunicationIdentifier has the following advantages:
2323
- Provides good auto-complete in IDEs.
2424
- Allows using a switch case by type to address different application flows.
2525
- Allows restricting communication to specific types.
26+
- Allow access to identifier details and use them to call other APIs (such as the Microsoft Graph API) to provide a rich experience for communication participants.
2627

2728
On top of this, the *CommunicationIdentifier* and the derived types (`MicrosoftTeamsUserIdentifier`, `PhoneNumberIdentifier`, etc.) can be converted to its string representation (Raw ID) and restored from the string, making the following scenarios easier to implement:
28-
- Extract identifier details from Raw IDs and use them to call other APIs (such as the Microsoft Graph API) to provide a rich experience for communication participants.
2929
- Store identifiers in a database and use them as keys.
3030
- Use identifiers as keys in dictionaries.
3131
- Implement intuitive REST CRUD APIs by using identifiers as key in REST API paths, instead of having to rely on POST payloads.
@@ -37,15 +37,22 @@ On top of this, the *CommunicationIdentifier* and the derived types (`MicrosoftT
3737
Get Raw ID from CommunicationUserIdentifier:
3838

3939
```csharp
40-
CommunicationIdentifier communicationIdentifier;
41-
String rawId = communicationIdentifier.RawId
40+
public async Task GetRawId()
41+
{
42+
ChatMessage message = await ChatThreadClient.GetMessageAsync("678f26ef0c");
43+
CommunicationIdentifier communicationIdentifier = message.Sender;
44+
String rawId = communicationIdentifier.RawId;
45+
}
4246
```
4347

4448
Instantiate CommunicationUserIdentifier from a Raw ID:
4549

4650
```csharp
47-
String rawId = "8:acs:bbbcbc1e-9f06-482a-b5d8-20e3f26ef0cd_45ab2481-1c1c-4005-be24-0ffb879b1130";
48-
CommunicationIdentifier communicationIdentifier = CommunicationIdentifier.FromRawId(rawId);
51+
public void CommunicationIdentifierFromGetRawId()
52+
{
53+
String rawId = "8:acs:bbbcbc1e-9f06-482a-b5d8-20e3f26ef0cd_45ab2481-1c1c-4005-be24-0ffb879b1130";
54+
CommunicationIdentifier communicationIdentifier = CommunicationIdentifier.FromRawId(rawId);
55+
}
4956
```
5057

5158
You can find more platform-specific examples in the following article: [Understand identifier types](./identifiers.md)

articles/communication-services/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ items:
161161
href: concepts/identifiers.md
162162
- name: Credentials best practices
163163
href: concepts/credentials-best-practices.md
164+
- name: Raw ID use cases
165+
href: concepts/raw-id-use-cases.md
164166
- name: Chat
165167
items:
166168
- name: Chat SDK overview

0 commit comments

Comments
 (0)