Skip to content

Commit

Permalink
EDGE-1027 updated README to match SDK specs for addParticipantToSessi…
Browse files Browse the repository at this point in the history
…on method
  • Loading branch information
mmcdonald-bw committed Jun 13, 2022
1 parent f5647a1 commit 725cb37
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ composer require bandwidth/sdk

### Initialize

```
```php

require "vendor/autoload.php";

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

### Create A Phone Call

```
```php

$voiceClient = $client->getVoice()->getClient();

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

### Send A Text Message

```
```php

$messagingClient = $client->getMessaging()->getClient();

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

### Create BXML

```
```php

$speakSentence = new BandwidthLib\Voice\Bxml\SpeakSentence("Hello!");
$speakSentence->voice("susan");
$speakSentence->locale("en_US");
Expand All @@ -90,7 +94,8 @@ echo $response->toBxml();

### Create A MFA Request

```
```php

$mfaClient = $client->getTwoFactorAuth()->getMFA();

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

### WebRtc Participant & Session Management

```
```php

$webRtcClient = $client->getWebRtc()->getClient();

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

$body = new BandwidthLib\WebRtc\Models\Subscriptions();
$body->sessionId = "1234-abcd";

$createParticipantResponse = $webRtcClient->createParticipant($accountId, $createParticipantBody);
$participantId = $createParticipantResponse->getResult()->participant->id;

$webRtcClient->addParticipantToSession($accountId, $sessionId, $participantId);
$webRtcClient->addParticipantToSession($accountId, $sessionId, $participantId, $body);
```

## Supported PHP Versions
Expand Down

0 comments on commit 725cb37

Please sign in to comment.