Skip to content

EDGE-1027 updated README to match SDK specs for addParticipantToSession method #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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