1

I am trying to integrate a virtual classroom into my website using software from a company called Braincert...

They provide a Joomla Component and a Virtual Classroom API also. (Here is the documentation to the API: https://www.braincert.com/developer/virtualclassroom-api )

This is what they say about the API:

BrainCert provides a RESTful interface to the resources in the Virtual Classroom e.g. classes, video recordings, shopping cart, etc. Once your API key has authenticated a BrainCert user, it can call a REST API endpoint using the obtained access token and get the corresponding resources. A simple example is getting the authenticated user's list of live classes using the API endpoint.

The features that I need to display on my site are shown on the documentation page... These are...

  • Schedule a new Live class
  • List Classes
  • Get Class
  • Get Class Launch URL
  • Remove Class

At this point the Joomla! component they provide is extremely sparse and only has the option of creating one page (menu item) that simply shows a long list of "classes".

I need to display all of the pages listed above...

They say that this "documentation allows you to get responses using JSON or XML where relevant."

Now from the examples they provide it seems as though I need to get "responses" using JSON... so taking the first example "Schedule a new Live class" I need to write the request parameters.

This is where I get stuck, I have no clue how any of this works. Can I do this in a custom HTML document? Do I need to make a brand new component from scratch to display and process all of this? How much coding/what skills am I going to need to do this?

They provide a table of "Request Requirements" but I have not idea how to turn this into something that can be used and displayed on my website! enter image description here

Apologies if my questions make absolutely no sense, I am clearly out of my depth here, but am willing to learn so any pointers in the right direction would be extremely appreciated!!

Kind regards,

Jethro.

  • For those interested, the Joomla component can be found at braincert.com/braincert-support/downloads/product/… – TryHarder Jan 2 '16 at 1:11
  • You could take their component and build your own from that. They probably have all necessary methods to make calls to API, since thei get classes from API. Create more views. They have List Classes view, so you make another ones you need. Last two features don't need a view. They can be links on Get class view. – Rene Korss Jan 4 '16 at 8:05
  • Maybe this neat rest implementation for Joomla may help extensions.joomla.org/extension/jbackend – Riccardo Zorn Jan 6 '16 at 11:32
2

It sounds like the are just returning the data from the API in JSON format for you to do with as you please. My initial thought would be that you need to use something like cURL or AJAX to request the data from their site, then decode the JSON information they send back so you have an array you can work with.

My preference would be cURL since it is easier for me to work with, but to each their own. Below is a simple cURL function for PHP that I use on several client sites that works wonderfully.

function urlGetContents($url, $useragent='cURL')
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
}

so if your address to query their API was

$url = 'http://www.braincert.com/joomlaapi.php?your_secret_key=xxxxx&method=scheduling';

you could do

$data = urlGetContents($url);

$results = json_decode($data);

print_r($results)
  • Awesome information Terry, I am slowly getting to grips with the issue, might design a custom component from scratch but am working up the courage (and php know how!), thanks for the great insight! – Jethro Hazelhurst Feb 5 '16 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.