ruby-d2l

SOAP = 0.4.x REST = 0.5+

Extremely limited functionality so far. At this point it’s just a proof of concept. Only a few SOAP calls are implemented at the moment.

This hopefully will eventually provide a much easier way to access the Web Services SOAP interface in Desire2Learn. This code should work with D2L versions 9.4.1 and prior. As of D2L version 9.4.1, a new REST based interface is available. This may be re-written to support REST when I get access to a 9.4.1 test system.

I don’t like that I’m having to build all the XML into this gem instead of just using the builtin stuff from Savon. If anyone figures out how to make that work let me know.

Installation

gem install ruby-d2l

Configuration

Create a user in your Desire2Learn instance for web services. It should have administrator privileges.

Then in your Ruby application you can use the configure block to set these values…

RubyD2L.configure do |config|
  config.username = "D2L_WEB_SERVICES_USERNAME"
  config.password = "D2L_WEB_SERVICES_PASSWORD"
  config.site_url = "https://d2l.mysite.edu"
  config.soap_logging = true   # defaults to FALSE unless set
end

Documentation

Code Example:

template =  RubyD2L::OrgUnit.get_course_template_by_code(:template_code => "TEMPLATE_CODE")
# using awesome_print gem
ap template

Contributing to ruby-d2l

Copyright © 2011 Matt Mencel. See LICENSE.txt for further details.