1+ # BigBlueButton API for PHP
2+
3+ ![ Home Image] ( https://raw.githubusercontent.com/wiki/bigbluebutton/bigbluebutton-api-php/images/header.png )
4+
5+ The official and easy to use ** BigBlueButton API for PHP** , makes easy for developers to use [ BigBlueButton] [ bbb ] API for ** PHP 5.4+** .
6+
17![ Packagist] ( https://img.shields.io/packagist/v/bigbluebutton/bigbluebutton-api-php.svg?label=release )
28![ PHP from Travis config] ( https://img.shields.io/travis/php-v/bigbluebutton/bigbluebutton-api-php.svg )
39[ ![ Downloads] ( https://img.shields.io/packagist/dt/bigbluebutton/bigbluebutton-api-php.svg?style=flat-square )] ( https://packagist.org/packages/bigbluebutton/bigbluebutton-api-php )
1824[ ![ PHP 7.2] ( https://img.shields.io/badge/php-7.2-9c9.svg?style=flat-square )] ( https://php.net/ )
1925[ ![ PHP 7.3] ( https://img.shields.io/badge/php-7.3-9c9.svg?style=flat-square )] ( https://php.net/ )
2026
21- # BigBlueButton API for PHP
22-
23- The official and easy to use ** BigBlueButton API for PHP** , makes easy for developers to use [ BigBlueButton] [ bbb ] API for ** PHP 5.4+** .
24-
25- ## Requirements
26-
27- - PHP 5.4 or above.
28- - Curl library installed.
29- - mbstring library installed.
30- - Xml library installed.
31-
32- BigBlueButton API for PHP is also tested to work with HHVM and fully compatible with PHP 7.0 and above.
33-
34- ## Install and usage tutorial
35-
36- We have written [ INSTALL] to show a full install and usage example. If you are familiar to composer and API please
37- continue top the next section.
38-
39- ## Installation
40-
41- ** bigbluebutton-api-php** can be installed via [ Composer] [ composer ] CLI
42-
43- ```
44- composer require bigbluebutton/bigbluebutton-api-php:~2.0.0
45- ```
46-
47- or by editing [ Composer] [ composer ] .json
48-
49- ``` json
50- {
51- "require" : {
52- "bigbluebutton/bigbluebutton-api-php" : " ~2.0.0"
53- }
54- }
55- ```
56-
57- ## Usage
58-
59- You should have environment variables ``` BBB_SECRET ``` and ``` BBB_SERVER_BASE_URL ``` defined in your sever.
60- \* if you are using Laravel you can add it in your .env
61-
62- The you will be able to call BigBlueButton API of your server. A simple usage example for create meeting looks like:
63-
64- ``` php
65- use BigBlueButton/BigBlueButton;
66-
67- $bbb = new BigBlueButton();
68- $createMeetingParams = new CreateMeetingParameters('bbb-meeting-uid-65', 'BigBlueButton API Meeting');
69- $response = $bbb->createMeeting($createMeetingParams);
70-
71- echo "Created Meeting with ID: " . $response->getMeetingId();
72- ```
73-
74- ## Example
75-
76- ### # Get meetings
77- ``` php
78-
79- use BigBlueButton\BigBlueButton;
80-
81- $bbb = new BigBlueButton();
82- $response = $bbb->getMeetings();
27+ ## Installation and usage
8328
84- if ($response->getReturnCode() == 'SUCCESS') {
85- foreach ($response->getRawXml()->meetings->meeting as $meeting) {
86- // process all meeting
87- }
88- }
89- ```
90-
91- ### # Create Meeting
92- ``` php
93-
94- use BigBlueButton\BigBlueButton;
95- use BigBlueButton\Parameters\CreateMeetingParameters;
96-
97- $bbb = new BigBlueButton();
98-
99- $createMeetingParams = new CreateMeetingParameters($meetingID, $meetingName);
100- $createMeetingParams->setAttendeePassword($attendee_password);
101- $createMeetingParams->setModeratorPassword($moderator_password);
102- $createMeetingParams->setDuration($duration);
103- $createMeetingParams->setLogoutUrl($urlLogout);
104- if ($isRecordingTrue) {
105- $createMeetingParams->setRecord(true);
106- $createMeetingParams->setAllowStartStopRecording(true);
107- $createMeetingParams->setAutoStartRecording(true);
108- }
109-
110- $response = $bbb->createMeeting($createMeetingParams);
111- if ($response->getReturnCode() == 'FAILED') {
112- return 'Can\'t create room! please contact our administrator.';
113- } else {
114- // process after room created
115- }
116- ```
117-
118- ### # Join Meeting
119- ``` php
120-
121- use BigBlueButton\BigBlueButton;
122- use BigBlueButton\Parameters\JoinMeetingParameters;
123-
124- $bbb = new BigBlueButton();
125-
126- // $moderator_password for moderator
127- $joinMeetingParams = new JoinMeetingParameters($meetingID, $name, $password);
128- $joinMeetingParams->setRedirect(true);
129- $url = $bbb->getJoinMeetingURL($joinMeetingParams);
130-
131- // header('Location:' . $url);
132- ```
133-
134- ### # Close Meeting
135- ``` php
136-
137- use BigBlueButton\BigBlueButton;
138- use BigBlueButton\Parameters\EndMeetingParameters;
139-
140- $bbb = new BigBlueButton();
141-
142- $endMeetingParams = new EndMeetingParameters($meetingID, $moderator_password);
143- $response = $bbb->endMeeting($endMeetingParams);
144- ```
145-
146- ### # Get Meeting Info
147- ``` php
148-
149- use BigBlueButton\BigBlueButton;
150- use BigBlueButton\Parameters\GetMeetingInfoParameters;
151-
152- $bbb = new BigBlueButton();
153-
154- $getMeetingInfoParams = new GetMeetingInfoParameters($meetingID, '', $moderator_password);
155- $response = $bbb->getMeetingInfo($getMeetingInfoParams);
156- if ($response->getReturnCode() == 'FAILED') {
157- // meeting not found or already closed
158- } else {
159- // process $response->getRawXml();
160- }
161- ```
162-
163-
164- ### # Get Recordings
165- ``` php
166-
167- use BigBlueButton\BigBlueButton;
168- use BigBlueButton\Parameters\GetRecordingsParameters;
169-
170- $recordingParams = new GetRecordingsParameters();
171- $bbb = new BigBlueButton();
172- $response = $bbb->getRecordings($recordingParams);
173-
174- if ($response->getReturnCode() == 'SUCCESS') {
175- foreach ($response->getRawXml()->recordings->recording as $recording) {
176- // process all recording
177- }
178- }
179- ```
180- * note that BigBlueButton need about several minutes to process recording until it available.*
181- * You can check in* ` bbb-record --watch `
182-
183-
184- ### # Delete Recording
185- ``` php
186-
187- use BigBlueButton\BigBlueButton;
188- use BigBlueButton\Parameters\DeleteRecordingsParameters;
189-
190- $bbb = new BigBlueButton();
191- $deleteRecordingsParams= new DeleteRecordingsParameters($recordingID); // get from "Get Recordings"
192- $response = $bbb->deleteRecordings($deleteRecordingsParams);
193-
194- if ($response->getReturnCode() == 'SUCCESS') {
195- // recording deleted
196- } else {
197- // something wrong
198- }
199- ```
29+ The [ wiki] contains all the documentation related to the PHP library. We have also written a samples to show a full
30+ install and usage example.
20031
20132## Submitting bugs and feature requests
20233
@@ -222,3 +53,4 @@ For every implemented feature add unit tests and check all is green by running t
22253[ bbb ] : http://bigbluebutton.org
22354[ composer ] : https://getcomposer.org
22455[ INSTALL ] : samples/README.md
56+ [ wiki ] : https://github.com/bigbluebutton/bigbluebutton-api-php/wiki
0 commit comments