The Brilliant Directories API can be called in the following ways:


HTML GET METHOD -  '/api/data/html/get/data_widgets/widget_name?name=developerConsoleEngine'`


JSON METHOD - '/api/widget/json/get/developerConsoleEngine'


Either using the GET HTML method (1st example) or the JSON Method (2nd example) will call the API and execute the needed code. To use the API you only need to do an AJAX call to a widget, so in the examples mentioned before, we were doing an AJAX call to a widget called 'developerConsoleEngine'.

The way this would work would be:

1. Create a widget on the brilliant directories site or create some Javascript or PHP code that calls upon the API on your site. So if your site's name is called "myawesomesite.com" and you were to call the API from an external source related to the Brilliant Directories site, the call would be: myawesomesite.com/api/widget/json/get/YourWidgetHere

2. The call from above (Using an AJAX type call) would execute in your Brilliant Directories site a background operation that would run said widget and return a JSON formatter set of values (or anything else you wanted to retrieve from the BD site or send to the BD site).

3. The API call is direct so there is not API key (public or private) and your calls can be processed through it.

A quick example of this would be using the JQuery Ajax calls seen in http://api.jquery.com/jquery.ajax/

Something along the lines of going from

 

$.ajax({
  url: "test.html",
  context: document.body
}).done(function() {
  $( this ).addClass( "done" );
});

 

to this if it were an external call:

 

$.ajax({
  url: "myawesomesite.com/api/widget/json/get/YourWidgetHere",
  context: document.body
}).done(function() {
  $( this ).addClass( "done" );
});

 

or this if it were a call from the same BD site:
 

$.ajax({
  url: "/api/widget/json/get/YourWidgetHere",
  context: document.body
}).done(function() {
  $( this ).addClass( "done" );
});