cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mgudites
Community Participant

How do we *USE* API?

Jump to solution

We are new to Canvas, coming off of Blackboard. I've got to say, I'm kind of shocked and dismayed at how little can be accomplished via the GUI. It seems like just about every thing I ask our implementation team about doing, the answer is always "you'll need to figure out how to do it in the API." 

Batch apply/change the Grade Scheme? Do it via the API.

Batch course-copy material? Do it via the API.

Batch publish a bunch of courses? Do it via the API.

I've been sent to this page a number of times: Canvas LMS API Documentation

We do have a programmer on staff who I know can figure this out. However, he's a busy guy and has limited time to be able to spend on this. The Canvas LMS API Documentation link above doesn't really give any information on where to begin...what do we need installed on a PC to make these calls, for example?

We've asked Canvas how to do this stuff, for some baseline instruction on how to setup a PC to run the scripts, only to be told "Instructure cannot tell you that, we're not a scripting company." I don't know how they can tell us "we can't tell you how to do this" when the software seems to rely on scripting for damn-near everything.

 

Can someone point me to some instruction please? Is there nothing out there, some kind of baseline instruction on how to prep a PC to run a script that can run against a Canvas environment, and how to build one of these scripts, so we can make some of these batch changes that came SO EASILY in Blackboard? Surely there are schools with Canvas who don't have an army of programmers at their disposal, but still have a need to accomplish tasks that the woefully inadequate GUI can't do. What do they do?!

Labels (1)
1 Solution

Accepted Solutions
mgudites
Community Participant

We're still trying to figure out how to script things. For example, scripting course-copying or batch-publishing courses.

My main problem with the "Canvas Universe" is that Instructure does not do anything to help on-board people with this API thing. They send you to the API Documentation page and say "here you go." For new clients there should really be at least a little bit of hand-holding because again, not all of us are programmers.

"Here's what you need to install/configure on your computer to run this stuff."

"Here are some sample scripts that will help you accomplish some basic tasks across multiple courses at once."

I realize it's all "open standards" or whatever but that doesn't mean jack to someone like me. If Instructure is going to rely so heavily on the API for even the most basic of tasks then there should really be more out there for beginners.

View solution in original post

24 Replies
agschmid
Community Contributor

https://insomnia.rest/  Insomnia is a nice tool to practice making API calls

robotcars
Community Champion

Simple browser based API tutorial. Developer Tools for the Canvas User 

Andrea mentioned Insomnia, also Paw – The most advanced API tool for Mac 

What languages does your programmer like?

I can provide pretty simple snippets in Ruby, Python, and Node.

jsavage2
Community Contributor

Hi  @mgudites , 

The transition from Blackboard to Canvas can definitely be a challenge. The advice to go to the API docs is given because Canvas (the system) is platform agnostic. A REST API is, at the end of the day, just a collection of web pages: you go to a particular, defined, url; Canvas performs a particular action and gives you a response. You can use any language or tool that's convenient for you. The examples in the docs use curl, which is included on nearly every linux/unix server and desktop, and can be a easily installed on Macs and Windows PCs (curl for Windows ). Most people who do much API work have a scripting language of choice, though, and there are good examples out there in almost every scripting language sysadmins use daily for configuration management on different platforms: Perl, Ruby, Python, PHP, .NET, Powershell, Node.js, etc. Even Bash for the particularly old-school.

That's a bit of a departure from Blackboard's "my way or the highway" approach to automation, but in an ideal world, it should make it easier to fit Canvas into whatever your school's existing IT ecosystem is. 

Stuart Ryan's Getting Started guide is definitely the place to start.

If you don't have particular preference and/or your school isn't an "X" shop, I'd suggest using the Python bindings from UCF (GitHub - ucfopen/canvasapi: Python API wrapper for Instructure's Canvas LMS ). Python seems to be the "it" scripting language at the moment and there's a lot of good information out there to get up and running quickly. 

But it doesn't have to be all scripting, either. Well-formatted JSON isn't difficult to read, and sometimes it's faster and/or better to just look at things with human eyes. There are also good API tools out there like PAW, which someone mentioned above, and Postman (Postman | API Development Environment ) that make it easy to manually construct urls with different parameters and read the responses, both for testing and for frequently-performed manual tasks.

The thing to remember is that Blackboard was cryptic and unintuitive at first, too, with that thing you do once a semester in a setting buried ten levels deep in some menu somewhere that you have to look up in manual the first 10 (or 20) times.

Having done this same transition, I'd also advise against putting the cart before the horse. Canvas is a very different product from some other LMS, and is designed to function in very different ways. Trying to replicate Blackboard's behavior is probably a recipe for frustration. A lot of the standard practices in Blackboard come from a very different time in LMS development, when the LMS was "it" as far as electronic materials we're concerned. So in addition to actual teaching and learning, Blackboard was designed to manage a lot of administrative "stuff" like posting syllabi, functioning as a student portal, and being a sort of general-purpose document distribution system. Canvas, though, is designed around the exception that it exists in an ecosystem with a dedicated student portal, which most places now have, and also probably a much simpler document distribution system like Google Drive or OneDrive or Dropbox.

Canvas is designed, pedagogically, to embrace a particular constructivist theory of education in general, and distance education in particular. The assumption is that faculty should be taking responsibility for their courses and be actively engaged in their design, management, and distribution, because that leads (in theory) to better student outcomes. Canvas resists central administration at almost every level, beyond basic enrollment, in favor of authority devolved to departments (sub-accounts) and ultimately faculty. So some of the things you're asking about--like publishing courses in bulk--are actually difficult by design, because the the expectation is that faculty should be making their courses available at a point that makes sense, pedagogically, for a particular course. Everything doesn't need to be published at the same time.

Similarly batch copy: direct batch copy isn't intuitive, but Canvas offers the Commons, for faculty to pull content from other courses, and Blueprint Courses for instructional designers to push content to courses, in addition to the normal course copy function that is available to faculty in all their courses. It's ultimately the same result as Blackboard, it's just initiated from a different point in the hierarchy.

Administrators *can* do it vis the API, but it's not really the way the system is designed to be used. It's kind of like offroading in a Porsche. Sure, you *can*, it's got 4WD, but the dealer isn't going to suggest it, and the people who do it modify them heavily for rallying.

Anyway, I've done several transitions from other systems to Canvas, and I'm happy to chat offline about the process, and about learning the API as somebody who isn't a professional programmer.

kblack
Community Champion

 @mgudites  - In addition to the ideas above, for some reason Instructure has not been very good about promoting the Live API tool that is a somewhat more user-friendly API.  While it is not good for anything where there are multiple requests, it may be handy for simpler, one-off API calls that may need to be done. 

There is information about this tool at a presentation that was done at InstructureCon 2016 here:   .  Basically, you can get there by your institution's base Canvas URL followed by /doc/api/live .  You still need to generate an access token, of course, but afterwards it's fairly easy to navigate once you figure out (based on the API documentation) where to go!  Not every single API call is there, but as I say it's a bit of a user-friendlier start for those times when you can't get to your programmer.  I still can't figure out why this is not more publicized out there, unless Instructure is simply no longer devoting resources to developing it.

mgudites
Community Participant

Thanks everyone for the responses so far! I sent our programmer some info on "Insomnia" and we're also checking out the Live API thing. That's definitely helpful and yeah, not sure why Instructure wouldn't promote that. 

pklove
Community Champion

If you are looking at Insomnia, you might also want to consider Postman (Postman | API Development Environment).

There are some articles on the web comparing them.

mgudites
Community Participant

We're still trying to figure out how to script things. For example, scripting course-copying or batch-publishing courses.

My main problem with the "Canvas Universe" is that Instructure does not do anything to help on-board people with this API thing. They send you to the API Documentation page and say "here you go." For new clients there should really be at least a little bit of hand-holding because again, not all of us are programmers.

"Here's what you need to install/configure on your computer to run this stuff."

"Here are some sample scripts that will help you accomplish some basic tasks across multiple courses at once."

I realize it's all "open standards" or whatever but that doesn't mean jack to someone like me. If Instructure is going to rely so heavily on the API for even the most basic of tasks then there should really be more out there for beginners.