Skip to content

Commit ff82749

Browse files
authored
Merge pull request #54 from Bandwidth/EDGE-1027
EDGE-1027 updated README to match SDK specs for addParticipantToSession method
2 parents 67542f3 + 725cb37 commit ff82749

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ composer require bandwidth/sdk
1919

2020
### Initialize
2121

22-
```
22+
```php
23+
2324
require "vendor/autoload.php";
2425

2526
$config = new BandwidthLib\Configuration(
@@ -40,7 +41,8 @@ $accountId = "12345";
4041

4142
### Create A Phone Call
4243

43-
```
44+
```php
45+
4446
$voiceClient = $client->getVoice()->getClient();
4547

4648
$body = new BandwidthLib\Voice\Models\CreateCallRequest();
@@ -59,7 +61,8 @@ try {
5961

6062
### Send A Text Message
6163

62-
```
64+
```php
65+
6366
$messagingClient = $client->getMessaging()->getClient();
6467

6568
$body = new BandwidthLib\Messaging\Models\MessageRequest();
@@ -78,7 +81,8 @@ try {
7881

7982
### Create BXML
8083

81-
```
84+
```php
85+
8286
$speakSentence = new BandwidthLib\Voice\Bxml\SpeakSentence("Hello!");
8387
$speakSentence->voice("susan");
8488
$speakSentence->locale("en_US");
@@ -90,7 +94,8 @@ echo $response->toBxml();
9094

9195
### Create A MFA Request
9296

93-
```
97+
```php
98+
9499
$mfaClient = $client->getTwoFactorAuth()->getMFA();
95100

96101
$body = new BandwidthLib\TwoFactorAuth\Models\TwoFactorCodeRequestSchema();
@@ -117,7 +122,8 @@ echo $response->getResult()->valid;
117122

118123
### WebRtc Participant & Session Management
119124

120-
```
125+
```php
126+
121127
$webRtcClient = $client->getWebRtc()->getClient();
122128

123129
$createSessionBody = new BandwidthLib\WebRtc\Models\Session();
@@ -133,10 +139,13 @@ $createParticipantBody->publishPermissions = array(
133139
BandwidthLib\WebRtc\Models\PublishPermissionEnum::VIDEO
134140
);
135141

142+
$body = new BandwidthLib\WebRtc\Models\Subscriptions();
143+
$body->sessionId = "1234-abcd";
144+
136145
$createParticipantResponse = $webRtcClient->createParticipant($accountId, $createParticipantBody);
137146
$participantId = $createParticipantResponse->getResult()->participant->id;
138147

139-
$webRtcClient->addParticipantToSession($accountId, $sessionId, $participantId);
148+
$webRtcClient->addParticipantToSession($accountId, $sessionId, $participantId, $body);
140149
```
141150

142151
## Supported PHP Versions

0 commit comments

Comments
 (0)