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

Knowing the URL to course before creation

Jump to solution

We are in the planning phase of our Canvas startup and I am looking into the integration parts. In our current course creation application used to create courses for other LMS than Canvas (Moodle and Sakai) we are setting an URL directly to courses before the courses has been created, we are using an unique ID.

For Canvas I can not find a way to do this, the only direct URL to a course is http://<my canvas>/courses/<course id> Where <course id> is generated at course creation.

Is there another way to do this or is is not possible to know a URL before the course has been created?

Tags (1)
1 Solution

Accepted Solutions
bneporadny
Community Champion

Hi Ulrik,

As far as I am aware of there is not a built in way to know the course URL prior to creating the course in Canvas as Canvas just assigns the next available course id upon creating a course. 

If you are going to rely on an automated system to create all your courses and never manually add a course in Canvas then you could set a starting number in your program and increment from there.  If that is not an option when you create a course using the #course api‌ it does return the course id necessary to know the course URL. 

View solution in original post

7 Replies
bneporadny
Community Champion

Hi Ulrik,

As far as I am aware of there is not a built in way to know the course URL prior to creating the course in Canvas as Canvas just assigns the next available course id upon creating a course. 

If you are going to rely on an automated system to create all your courses and never manually add a course in Canvas then you could set a starting number in your program and increment from there.  If that is not an option when you create a course using the #course api‌ it does return the course id necessary to know the course URL. 

View solution in original post

Thanks Brian, good idea but in our case it is possible to create courses both from the API and within Canvas. 

The described problem occurs for courses created with the API, but the URL is today saved in another part of the system where there are no write backs of the course creation data.

But if there are no alternatives we may end up with a re-design of this.

Thanks again, regards /Ulrik

 @bneporadny 

Just a note, that in the multi-tenant environment that is Canvas, most institutions would not be able to depend on those incremental IDs, unless they have their own dedicated shard. You see this in any global id, which the first numbers preceding the local canvas_id, ex. 120000001234567, where 12 is the shard, and new record is being creating against the shard, which means the next value may be created and used by your shard neighbors and may not be in your system.

ie. You cannot depend on 1234567 following 1234566, unless you are the only tenant on that shard. You'd have to talk to Canvas support or engineers to find out. The smaller your institution the more likely you are sharing.

Additionally if you were to count and track these, course resets (which delete and create a new course) would have to be tracked.

Hi Ulrik,

Just to confirm what Brian wrote; you can specify courseIDs in scripts or calls or CSV uploads.  You do need to guard against data integrity issues if you are using multiple course creation methods.  There is not a way to specify course urls automatically although you can anticipate them if you are using preset course IDs.

nr2522
Community Champion
robotcars
Community Champion

 @nr2522 

That worked for me! Do you know how this performs with a reset course?

nr2522
Community Champion

Hi, carroll-ccsd.

I‌ haven't done that before, but I imagine it should work with most calls that can be done with a URL and SIS course ID.

I should have included this earlier: Object IDs, SIS IDs, and special IDs - Canvas LMS REST API Documentation .

Best,

Nelson