|
API
BigBlueButton Third-Party Integration API.
OverviewThis document outlines the API that is available for integrating BigBlueButton with other applications. The changes between releases will be described in the document. Features which are not currently implemented will be clearly marked as such. The API is implemented with the end-user in mind. To call the API, you simply make an HTTP request to a URL with the query parameters supplying the information needed for the call. The API returns an XML response. The current API implementation lies on the bigbluebutton-web component, which has been written using the Grails framework. API Changes in ReleasesVersion 0.64Added new API calls:
Version 0.7In 0.70, we made a couple of changes that will force you to update your API integrations. These changes were necessary to improve the security of the API and our ability to add features in future releases. We apologize for any inconvenience this may have caused. Added new API calls:
Fixes:
Version 0.8Added new API calls:
Updates:
For a detail of the updates in the api 0.8 check the following link Version Master BranchNo changes yet.
API Security ModelThe API provides a way to be secured so that third-party apps may make calls to it, but not allow other people (end users) to make similar calls to create their own meetings, etc. For instance, a third party application that is integrated with the API may embed a JavaScript URL that calls to the BBB API to create a meeting. An end user will be able to see this URL in their browser and should not be allowed to modify a parameter (for example, the meeting ID) and create their own meeting. By doing so, they could create meetings that were not tracked by the third-party app, which could present a billing problem, etcetera. They should also not be able to modify any parameter (for instance the maximum attendees) to modify the meeting that is being created by the third party app. Those examples are clearly abuses of the system, and therefore must be protected against. The API must provide a way of enabling this protection. ConfigurationThe securitySalt is set in /var/lib/tomcat6/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties Look for the parameter beans.dynamicConferenceService.securitySalt=<your_salt> IMPORTANT: DO NOT ALLOW END USERS TO KNOW YOUR SECURITY SALT OR ELSE YOUR SECURITY WILL BE COMPROMISED. UsageThe implementation of this security model lies in ApiController.groovy. It entails creating a checksum out of the combination of the entire HTTP query string and a server-configured security token. To use the security model, you must be able to create an SHA-1 checksum out of the call name plus the query string plus the security salt that you configured on your server. To do so, follow these steps:
If you configured a security salt on your server, you MUST send this checksum with EVERY API call. Since end users do not know your security salt, they can not fake calls to the server, and they can not modify your calls – since changing a single parameter name or value by only one character will completely change the checksum required to validate the call. Implementations of the SHA-1 functionality exist in nearly all programming languages. Here are example methods or links to example implementations for various languages:
Error handling
API ResourcesAdministrationIn the following section is described the administration calls
MonitoringIn the following section is described the monitoring calls
Recording
API CallsNOTE: Parameters marked with (NFS) are not yet fully supported. You can pass them in to the controller, but they may not have any actual effect on the conference. This is more a limitation based on support by the actual BBB application more than the API itself. Standard parameters and responsesThe following response parameters are standard to every call and may be returned from any call. Parameters:
Response:
Create MeetingCreates a bigbluebutton meeting, according to the parameters passed. Resource URL: http://yourserver.com/bigbluebutton/api/create?[parameters]&checksum=[checksum]Parameters:
Example Requests:
Example Response: <response>
<returncode>SUCCESS</returncode>
<meeting>
<meetingID>Test</meetingID>
<createTime>1308591802</createTime>
<attendeePW>ap</attendeePW>
<moderatorPW>mp</moderatorPW>
<hasBeenForciblyEnded>false</hasBeenForciblyEnded>
<messageKey>createSuccess</messageKey>
<message>Meeting has been create</message>
</meeting>
</response> Preupload SlidesYou can now preupload slides within the create call. You can specify an URL for BigBlueButton to download and process the slides, or you can embed the slides in base64 as part of the POST request. For use the preupload slides part:
<?xml version="1.0" encoding="UTF-8"?>
<modules>
<module name="presentation">
<document url="http://www.samplepdf.com/sample.pdf" />
<document name="sample-presentation.pdf">JVBERi0xLjQKJ....
[clipped here]
....0CiUlRU9GCg==
</document>
</module>
</modules> For more information about the preupload slides check the following link. For a complete example of the preupload slides check the following demos: demo7 and demo8.
Join MeetingJoins automatically a user to the meeting specified in the meetingID parameter. Resource URL: http://yourserver.com/bigbluebutton/api/join?[parameters]&checksum=[checksum]Parameters:
Example Requests:
Example Response: There is no XML response for this call if it is properly formatted. You should simply redirect the user to the call URL, and they will be entered into the meeting.NOTE: there is the possibility that a user is sent to a join URL that is invalid right now. For instance, if the client application forms the URL incorrectly, or sends the user to join a meeting that hasn't been created, then the user will end up seeing the XML that would be returned as an error. We need to figure out a better way of handling this.
Is Meeting RunningThis call enables you to simply check on whether or not a meeting is running by looking it up with your meeting ID. Resource URL: http://yourserver.com/bigbluebutton/api/isMeetingRunning?[parameters]&checksum=[checksum]Parameters:
Example Requests: Example Response: <response> <returncode>SUCCESS</returncode> <running>true</running> </response> running can be “true” or “false” that signals whether a meeting with this ID is currently running.
End MeetingUse this to forcibly end a meeting and kick all participants out of the meeting. Resource URL: http://yourserver.com/bigbluebutton/api/end?[parameters]&checksum=[checksum]Parameters:
Example Requests: Example Response: <response> <returncode>SUCCESS</returncode> <messageKey>sentEndMeetingRequest</messageKey> <message> A request to end the meeting was sent. Please wait a few seconds, and then use the getMeetingInfo or isMeetingRunning API calls to verify that it was ended. </message> </response> IMPORTANT NOTE: You should note that when you call end meeting, it is simply sending a request to the backend (Red5) server that is handling all the conference traffic. That backend server will immediately attempt to send every connected client a logout event, kicking them from the meeting. It will then disconnect them, and the meeting will be ended. However, this may take several seconds, depending on network conditions. Therefore, the end meeting call will return a success as soon as the request is sent. But to be sure that it completed, you should then check back a few seconds later by using the getMeetingInfo or isMeetingRunning calls to verify that all participants have left the meeting and that it successfully ended. TODO: In future iterations, this call will also mark a meeting that has ended so that it can not be immediately restarted with the same join meeting URLs that initially dropped users into the meeting. This will protect against devious users restarting a meeting that you just kicked them from.
Get Meeting InfoThis call will return all of a meeting's information, including the list of attendees as well as start and end times. Resource URL: http://yourserver.com/bigbluebutton/api/getMeetingInfo?[parameters]&checksum=[checksum]Parameters:
Example Requests: Example Response: <response>
<returncode>SUCCESS</returncode>
<meetingName>Test</meetingName>
<meetingID>test01</meetingID>
<createTime>1315254777880</createTime>
<voiceBridge>70775</voiceBridge>
<attendeePW>ap</attendeePW>
<moderatorPW>mp</moderatorPW>
<running>true</running>
<recording>false</recording>
<hasBeenForciblyEnded>false</hasBeenForciblyEnded>
<startTime>1315254785069</startTime>
<endTime>0</endTime>
<participantCount>1</participantCount>
<maxUsers>20</maxUsers>
<moderatorCount>1</moderatorCount>
<attendees>
<attendee>
<userID>1</userID>
<fullName>John Doe</fullName>
<role>MODERATOR</role>
</attendee>
</attendees>
<metadata/>
<messageKey/>
<message/>
</response>TODO: add participant join / disconnect times to each attendee node.
Get MeetingsThis call will return a list of all the meetings found on this server. Resource URL: http://yourserver.com/bigbluebutton/api/getMeetings?checksum=[checksum]Parameters: Now, In BigBlueButton 0.8 is not required to pass any parameter for this call.Example Requests: Example Response: <response>
<returncode>SUCCESS</returncode>
<meetings>
<meeting>
<meetingID>test01</meetingID>
<meetingName>Test</meetingName>
<createTime>1315254777880</createTime>
<attendeePW>ap</attendeePW>
<moderatorPW>mp</moderatorPW>
<hasBeenForciblyEnded>false</hasBeenForciblyEnded>
<running>true</running>
</meeting>
</meetings>
</response>
Get RecordingsRetrieves the recordings that are available for playback for a given meetingID (or set of meeting IDs). Resource URL: http://yourserver.com/bigbluebutton/api/getRecordings?[parameters]&checksum=[checksum]Parameters:
Example Requests:
Example Response: <response>
<returncode>SUCCESS</returncode>
<recordings>
<recording>
<recordID>183f0bf3a0982a127bdb8161-1308597520</recordID>
<meetingID>CS101</meetingID>
<name><![CDATA[On-line session for CS 101]]></name>
<published>false</published>
<startTime>Thu Mar 04 14:05:56 UTC 2010</startTime>
<endTime>Thu Mar 04 15:01:01 UTC 2010</endTime>
<metadata>
<title><![CDATA[Test Recording]]></title>
<subject><![CDATA[English 232 session]]></subject>
<description><![CDATA[First Class]]></description>
<creator><![CDATA[Fred Dixon]]></creator>
<contributor><![CDATA[Richard Alam]]></contributor>
<language><![CDATA[en_US]]></language>
</metadata>
<playback>
<format>
<type>simple</type>
<url>http://server.com/simple/playback?recordID=183f0bf3a0982a127bdb8161-1...</url>
<length>62</length>
</format>
</playback>
</recording>
<recording>
<recordID>183f0bf3a0982a127bdb8161-13085974450</recordID>
<meetingID>CS102</meetingID>
...
</recording>
</recordings>
<messageKey/>
<message/>
</response>
Publish RecordingsPublish and unpublish recordings for a given recordID (or set of record IDs). Resource URL: http://yourserver.com/bigbluebutton/api/publishRecordings?[parameters]&checksum=[checksum]Parameters:
Example Requests:
Example Response: <response>
<returncode>SUCCESS</returncode>
<published>true</published>
</response>
Delete RecordingsDelete one or more recordings for a given recordID (or set of record IDs). Resource URL: http://yourserver.com/bigbluebutton/api/deleteRecordings?[parameters]&checksum=[checksum]Parameters:
Example Requests:
Example Response: <response>
<returncode>SUCCESS</returncode>
<deleted>true</deleted>
</response>
API Sample CodeOverviewBigBlueButton provides API Sample Codes so you can integrated easily with your application. Feel free to contribute and post your implementation of the API in other language code in the bigbluebutton-dev mailing list. Language codeJSPIt is updated with the latest API version: https://github.com/bigbluebutton/bigbluebutton/tree/master/bbb-api-demo PHPNeeds to be updated, however you can find it useful: https://github.com/bigbluebutton/bigbluebutton/tree/master/labs/bbb-api-php You need to enable the "allow_url_fopen" to "On" in your php.ini file so this example can work. Simply add/replace to your php.ini file : allow_url_fopen = On RubyNeeds to be updated, however you can find it useful: https://github.com/mconf/bigbluebutton-api-ruby JavascriptSee the Chrome extension that allows for API testing. Obviously implementing your entire integration in JavaScript is risky because you must expose your security salt. This is not recommended. Also note that if you integrate using Javascript and you are calling the API on a different domain than the one that your JavaScript is being served from, you will have cross-site scripting issues. Also, needs to be updated: http://github.com/jthomerson/BigBlueButton-api-chrome-extension API Testing ToolsIf you are developing in bigbluebutton, most of the time you will need to make many API calls. You can use the following tools that will help you for your tests. BBB API BuddyThis application will help you to automatically generate the most commons URL's of the bigbluebutton API. You just need to fill the fields and test! http://www.omarshammas.com/bbbapibuddy you can check the code in: https://github.com/omarshammas/bigbluebutton-API-Buddy Chrome extensionThere is a Chrome extension that allows for quickly testing the API functionality. It's currently working with the 0.7 API. You can also use it to help you understand usage of the API. The extension can be found at: https://chrome.google.com/extensions/detail/ncbonhmhjnamefpmmjdpbohnkbeliehb The code for the extension can be found at: http://github.com/jthomerson/BigBlueButton-api-chrome-extension
Desired Future FeaturesSupport for JSON/JSONP
Meeting event callbacksThis may actually even be called a “reverse API” - where we define an interface that the third- party application can implement to be notified of events. This would not be necessary for the first version of the API, but would be a nice feature for future enhancements. More details:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||