Created
January 16, 2012 23:37
-
-
Save codekitchen/1623642 to your computer and use it in GitHub Desktop.
talking to canvas with faraday-stack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'faraday_stack' | |
conn = FaradayStack.build 'https://canvas.beta.instructure.com/' | |
conn.headers[:authorization] = "Bearer #{api_token}" | |
resp = conn.get '/api/v1/courses?include[]=syllabus_body' | |
puts("%-50s %s" % ['course name', 'enrollment']) | |
resp.body.each do |course| | |
puts("%-50s %s" % [course['name'], course['enrollments'].first['type']]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment