The unofficial and easiest to use BigBlueButton API for PHP, makes easy for developers to use BigBlueButton API v2.2 for PHP 7.2+.
This API uses BigBlueButton and is not endorsed or certified by BigBlueButton Inc. BigBlueButton and the BigBlueButton Logo are trademarks of BigBlueButton Inc.
To explain why you should use a fork, we have to explain why we created our own fork. While BigBlueButton is a great product, contributing as an external developer is often cumbersome. Bug fixes and features are not merged. Modern enhancements are postponed or not allowed. Therefore 4 people from different companies and universities decided to create a open minded alternative to the existing PHP API. While we are still backwards compatible, this fork has the following advantages:
- Don't require unsecure environment variables
- Tests are split into unit and integration tests and therefore working
- Development is simplified through git hooks and contributor guidelines
- Documentation is up-to-date and complete
- API is fixed and extended to exploit the full potential
- Require at least PHP 7.2, which allows to make the code more efficient and readable
In order to use this library you have to make sure to meet the following requirements:
- PHP 7.2 or above.
- curl library installed.
- mbstring library installed.
- xml library installed.
We are using composer to manage and install all libraries, so you need to use it too. If you setup composer for your project, you just have to add this API to your required section via
composer require littleredbutton/bigbluebutton-api-php
To make any requests to your BigBlueButton instance, you have to create an API object:
use BigBlueButton/BigBlueButton;
$bbb = new BigBlueButton($apiUrl, $apiSecret);
If you didn't use composer before, make sure that you include vendor/autoload.php
.
use BigBlueButton\Parameters\IsMeetingRunningParameters;
$meetingParams = new IsMeetingRunningParameters('foobar');
try {
$response = $bbb->isMeetingRunning($meetingParams);
if (!$response->success() && !$response->failed()) {
// invalid url
}
if (!$response->success()) {
// invalid secret
}
// url and secret are valid
} catch (\Exception $e) {
// invalid url
}
$version = $bbb->getApiVersion()->getVersion();
use BigBlueButton\Parameters\CreateMeetingParameters;
$createMeetingParams = new CreateMeetingParameters($meetingID, $meetingName);
$createMeetingParams->setAttendeePassword($attendee_password);
$createMeetingParams->setModeratorPassword($moderator_password);
$createMeetingResponse = $bbb->createMeeting($createMeetingParams);
if ($createMeetingResponse->success()) {
// process after room created
}
⚠️ Not officially supported by bbb
Guest policy Beside the guest policies ALWAYS_ACCEPT, ALWAYS_DENY, and ASK_MODERATOR there is also the option ALWAYS_ACCEPT_AUTH. sourcecode
ASK_MODERATOR is asking the moderator(s) to accept or decline the join of a user or guest. When using our api guest users are by default marked as 'unauthorized' users.
By using the option ALWAYS_ACCEPT_AUTH all authorized users (non-guests) can directly join the meeting and the moderators approval is only required for unauthorized users, like guests.
$createMeetingParams->setGuestPolicyAlwaysAcceptAuth();
use BigBlueButton\Parameters\JoinMeetingParameters;
$joinMeetingParams = new JoinMeetingParameters($room->uid, $displayname, $password);
$joinMeetingParams->setCreationTime($createMeetingResponse->getCreationTime());
$joinMeetingParams->setJoinViaHtml5(true);
$joinMeetingParams->setRedirect(true);
$joinUrl = $bbb->getJoinMeetingURL($joinMeetingParams);
// e.g. header('Location:' . $joinUrl);
use BigBlueButton\Parameters\EndMeetingParameters;
$endMeetingParams = new EndMeetingParameters($meetingID, $moderator_password);
$response = $bbb->endMeeting($endMeetingParams);
$response = $bbb->getDefaultConfigXML();
if ($response->failed()) {
// error handling
}
$response->getRawXml();
use BigBlueButton\Parameters\SetConfigXMLParameters;
$setConfigXmlParams = new SetConfigXMLParameters($meetingId);
$setConfigXmlParams->setRawXml($rawXml);
$response = $bbb->setConfigXML($setConfigXmlParams);
if ($response->failed()) {
// error handling
}
$response->getToken();
$response = $bbb->getMeetings();
if ($response->failed()) {
// error handling
}
$meetings = $response->getMeetings();
// e.g. $meetings[0]->getMeetingName();
use BigBlueButton\Parameters\IsMeetingRunningParameters;
$isMeetingRunningParams = new IsMeetingRunningParameters($meetingId);
$response = $bbb->isMeetingRunning($isMeetingRunningParams);
if ($response->success() && $response->isRunning()) {
// meeting is running
}
use BigBlueButton\Parameters\GetMeetingInfoParameters;
$getMeetingInfoParams = new GetMeetingInfoParameters($meetingID, $moderator_password);
$response = $bbb->getMeetingInfo($getMeetingInfoParams);
if ($response->failed()) {
// error handling
}
// process $response->getRawXml();
use BigBlueButton\Parameters\GetRecordingsParameters;
$recordingParams = new GetRecordingsParameters();
$recordingParams->setRecordId($recordId); // omit to get a list of all recordings
$recordingParams->setState('any');
$response = $bbb->getRecordings($recordingParams);
if (!$response->success()) {
// handle error
}
$records = $response->getRecords();
// e.g. $records[0]->getParticipantCount();
use BigBlueButton\Parameters\PublishRecordingsParameters;
$publishRecordingsParams = new PublishRecordingsParameters($recordingId, $publish);
$response = $bbb->publishRecordings($publishRecordingsParams);
if ($response->success() && $response->isPublished()) {
// record was published
}
use BigBlueButton\Parameters\DeleteRecordingsParameters;
$deleteRecordingsParams= new DeleteRecordingsParameters($recordingID);
$response = $bbb->deleteRecordings($deleteRecordingsParams);
if ($response->success()) {
// meeting was deleted
}
Bugs and feature request are tracked on GitHub