Putting courses in subaccounts via the API

322 views
Skip to first unread message

Kenneth Mayer

unread,
Oct 3, 2014, 4:36:27 PM10/3/14
to canvas-l...@googlegroups.com
I'm trying to import SIS courses into the correct sub_accounts, but nothing seems to work.
Here is a great mystery.
The courses list shows 300+ courses,
The subaccount page shows 300+ courses all in the root account
But API queries show just 10 courses!
Here was the crude API I used in the console:
for(var i=0;i<200;i++) $.getJSON("/api/v1/accounts/"+i+"/courses", function(data) {  console.log(data); });   

At first I thought it was my browser console limiting reports to 10 objects, but It doesn't matter if the API query is done via PHP with my access_token or by console. (And there I did it by listing subaccounts and running a query for each subaccount instead of the crude way).

Why does the import ignore my account_id settings?

Here are the images:





Chris Herdt

unread,
Oct 3, 2014, 5:57:02 PM10/3/14
to canvas-l...@googlegroups.com
Please see the Canvas API documentation regarding pagination:
https://canvas.instructure.com/doc/api/file.pagination.html



--
Chris Herdt
Web Applications Developer
http://osric.com/chris/

Kenneth Mayer

unread,
Oct 6, 2014, 1:41:53 PM10/6/14
to canvas-l...@googlegroups.com
Thank you!
I still don't know why the courses aren't going to the proper subaccounts, but you've helped me with the diagnosis!

Kenneth Mayer

unread,
Feb 3, 2015, 1:02:35 PM2/3/15
to canvas-l...@googlegroups.com
OK, the SIS Import is working now, but I have a problem.
We revised out sub-account structure, so I created new sub-accounts, and put the new Canvas account ID #s in our SIS. However, the SIS imports are not moving the courses to the new sub-accounts.
I tried using the SIS-Import interface on the website and clicked override UI stickiness, and it still did not work.

Is it possible to move courses to other subaccounts in any way except manually one-by-one?

Thanks!

Ken

Jihoon Yoo

unread,
Feb 4, 2015, 2:03:38 PM2/4/15
to canvas-l...@googlegroups.com
Kenneth, you should be able to move courses from one sub-accounts to another by re-importing those courses vis SIS imports: however, sub-account id  should be 'SIS ID' not the Canvas generated numeric value. 

Kenneth Mayer

unread,
Feb 4, 2015, 2:22:15 PM2/4/15
to canvas-l...@googlegroups.com
Aha! Thank you! I'll try that and see what happens.

--

---
You received this message because you are subscribed to a topic in the Google Groups "Canvas LMS Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/canvas-lms-users/Oi-MNs8GXps/unsubscribe.
To unsubscribe from this group and all its topics, send an email to canvas-lms-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
----------------------
Ken Mayer
ken.i...@gmail.com

Save our in-boxes! http://emailcharter.org
Reply all
Reply to author
Forward
0 new messages