@@ -19,7 +19,8 @@ composer require bandwidth/sdk
19
19
20
20
### Initialize
21
21
22
- ```
22
+ ``` php
23
+
23
24
require "vendor/autoload.php";
24
25
25
26
$config = new BandwidthLib\Configuration(
@@ -40,7 +41,8 @@ $accountId = "12345";
40
41
41
42
### Create A Phone Call
42
43
43
- ```
44
+ ``` php
45
+
44
46
$voiceClient = $client->getVoice()->getClient();
45
47
46
48
$body = new BandwidthLib\Voice\Models\CreateCallRequest();
59
61
60
62
### Send A Text Message
61
63
62
- ```
64
+ ``` php
65
+
63
66
$messagingClient = $client->getMessaging()->getClient();
64
67
65
68
$body = new BandwidthLib\Messaging\Models\MessageRequest();
78
81
79
82
### Create BXML
80
83
81
- ```
84
+ ``` php
85
+
82
86
$speakSentence = new BandwidthLib\Voice\Bxml\SpeakSentence("Hello!");
83
87
$speakSentence->voice("susan");
84
88
$speakSentence->locale("en_US");
@@ -90,7 +94,8 @@ echo $response->toBxml();
90
94
91
95
### Create A MFA Request
92
96
93
- ```
97
+ ``` php
98
+
94
99
$mfaClient = $client->getTwoFactorAuth()->getMFA();
95
100
96
101
$body = new BandwidthLib\TwoFactorAuth\Models\TwoFactorCodeRequestSchema();
@@ -117,7 +122,8 @@ echo $response->getResult()->valid;
117
122
118
123
### WebRtc Participant & Session Management
119
124
120
- ```
125
+ ``` php
126
+
121
127
$webRtcClient = $client->getWebRtc()->getClient();
122
128
123
129
$createSessionBody = new BandwidthLib\WebRtc\Models\Session();
@@ -133,10 +139,13 @@ $createParticipantBody->publishPermissions = array(
133
139
BandwidthLib\WebRtc\Models\PublishPermissionEnum::VIDEO
134
140
);
135
141
142
+ $body = new BandwidthLib\WebRtc\Models\Subscriptions();
143
+ $body->sessionId = "1234-abcd";
144
+
136
145
$createParticipantResponse = $webRtcClient->createParticipant($accountId, $createParticipantBody);
137
146
$participantId = $createParticipantResponse->getResult()->participant->id;
138
147
139
- $webRtcClient->addParticipantToSession($accountId, $sessionId, $participantId);
148
+ $webRtcClient->addParticipantToSession($accountId, $sessionId, $participantId, $body );
140
149
```
141
150
142
151
## Supported PHP Versions
0 commit comments