Skip to content

Commit d1fa81f

Browse files
[communication] Address readme issues (Azure#15081)
1 parent 48e88c6 commit d1fa81f

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

sdk/communication/communication-chat/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const createChatThreadRequest = {
8989
const createChatThreadOptions = {
9090
participants: [
9191
{
92-
id: '<USER_ID>',
92+
id: { communicationUserId: '<USER_ID>' },
9393
displayName: '<USER_DISPLAY_NAME>'
9494
}
9595
]

sdk/communication/communication-identity/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ let { token } = await client.getToken(user, ["chat"]);
9696
To refresh the user token, issue another token with the same user.
9797

9898
```typescript
99-
{ token } = await client.getToken(user, ["chat"]);
99+
let { token } = await client.getToken(user, ["chat"]);
100100
```
101101

102102
### Creating a user and a token in a single request
103103

104104
For convenience, use `createUserAndToken` to create a new user and issue a token with one function call. This translates into a single web request as opposed to creating a user first and then issuing a token.
105105

106106
```typescript
107-
let { user, token } = await client.createUserWithToken(["chat"]);
107+
let { user, token } = await client.createUserAndToken(["chat"]);
108108
```
109109

110110
### Revoking tokens for a user

sdk/communication/communication-phone-numbers/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,16 @@ Use the `beginSearchAvailablePhoneNumbers` method to search for phone numbers an
110110
`beginSearchAvailablePhoneNumbers` is a long running operation and returns a poller.
111111

112112
```typescript
113-
import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
113+
import {
114+
PhoneNumbersClient,
115+
SearchAvailablePhoneNumbersRequest
116+
} from "@azure/communication-phone-numbers";
114117

115118
const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
116119
const client = new PhoneNumbersClient(connectionString);
117120

118121
async function main() {
119-
const searchRequest = {
122+
const searchRequest: SearchAvailablePhoneNumbersRequest = {
120123
countryCode: "US",
121124
phoneNumberType: "tollFree",
122125
assignmentType: "application",
@@ -130,7 +133,7 @@ async function main() {
130133
const searchPoller = await client.beginSearchAvailablePhoneNumbers(searchRequest);
131134

132135
// The search is underway. Wait to receive searchId.
133-
const searchResults = searchPoller.pollUntilDone();
136+
const searchResults = await searchPoller.pollUntilDone();
134137
console.log(`Found phone number: ${searchResults.phoneNumbers[0]}`);
135138
console.log(`searchId: ${searchResults.searchId}`);
136139
}
@@ -209,7 +212,10 @@ Use the `beginUpdatePhoneNumberCapabilities` method to update the capabilities o
209212
`beginUpdatePhoneNumberCapabilities` is a long running operation and returns a poller.
210213

211214
```typescript
212-
import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
215+
import {
216+
PhoneNumbersClient,
217+
PhoneNumberCapabilitiesRequest
218+
} from "@azure/communication-phone-numbers";
213219

214220
const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
215221
const client = new PhoneNumbersClient(connectionString);
@@ -218,7 +224,7 @@ async function main() {
218224
const phoneNumberToUpdate = "<phone-number-to-update>";
219225

220226
// This will update phone number to send and receive sms, but only send calls.
221-
const updateRequest = {
227+
const updateRequest: PhoneNumberCapabilitiesRequest = {
222228
sms: "inbound+outbound",
223229
calling: "outbound"
224230
};

0 commit comments

Comments
 (0)