Name | Return Value | Description |
SK.API( "authentication token", request_params ) |
Constructor |
|
execute( "API command", { <param1>: <value1>, <param2>: <value2>, ... }, callback ) |
Executes the request. |
|
buildRequest( command, params, callback ) |
Request.JSON object which should be executed manually after that |
Generates a MooTools Request.JSON object. The parameters are the same as for the "execute". Note that by default the request is using a "post" method, so make sure you invoke "send". If you set the method to be "get", you should invoke "get" to the Request.JSON object instance. |
Examples
Getting all databases for an account
<script type="text/javascript"> new SK.API( null, // Will use the current session ID null // Leave the default properties ).execute( "db.get_all", { // No parameters for this API call }, function( success, message, data ) { if ( ! success ) { alert( message ); return; } // Inject the name of each database in the "databases" div below data.databases.each( function( db ) { var name = db.name; new Element( 'div', { text: name } ).inject( $( 'databases' ) ); } ); } ); </script> <div id="databases"></div> |