Ruby

Ruby

Our open source Ruby client provides a simple way to invoke the API from Ruby.

Overview

To download the Ruby client, right-click /clients/lms_api.rb and the save the contents to your local computer.

Example: code

The following example lists all the courses in your site:

begin   api = LMS::Api.new(:host => 'yourschool.edu20.com', :api_key => '3616-1-d1e9...8f88', :version => 1, :use_ssl => true)   puts "get_all_classes:"   puts   classes = api.get_all_classes   for klass in classes     puts "#{klass['id']}: #{klass['name']}, #{klass['style']}"   end rescue Exception => exception   puts "Exception: #{exception.message}" end

Example: output

get_all_classes:

12461 => Introduction to Marketing, Self paced
12883 => Sales pitches, Self paced
13232 => Advanced Marketing, Instructor
14365 => Defensive Driving, Instructor

    • Related Articles

    • API 3.0

      Introduction Welcome to the help area for API 3.0, the third generation of our Application Programming Interface. API 3.0 implements RESTFUL best practices whenever possible, and includes an OpenAPI 3.0.2 specification so that it can be easily ...
    • Java

      Overview Our open source Java client provides a simple way to invoke the API from Java. Installation You can download the Java API from/clients/java-api-client.zip and include it in your project. Dependencies: http://unirest.io/java.html and ...
    • Javascript

      Overview Our open source Javascript client provides a simple way to invoke the API from Javascript. To download the Javascript client, right-click /javascripts/lms_api.js and the save the contents to your local computer. The Javascript client is ...
    • NET

      Overview Our open source C# client provides a simple way to invoke the API from C#. Installation You can download the C# API from /clients/csharp-api-client.zip and include it in your project. Depencencies: https://github.com/mgholam/fastJSON ...
    • PHP

      Overview Our open source PHP client provides a simple way to invoke the API from PHP. To download the PHP client, right-click /clients/lms_api.php and then save the contents to your local computer. Example: code The following example lists all the ...