Activity Feed
- Kudoed Postman Canvas API collection for dsweeney2. 02-23-2023 07:27 AM
- Got a Kudo for Re: Uploading Quiz Content via .csv file(?). 02-14-2023 09:01 AM
- Kudoed Re: Google App Scripts - URLFetchApp API Endpoint Requests other than GET method for themidiman. 07-14-2022 12:47 PM
- Posted Re: Google App Scripts - URLFetchApp API Endpoint Requests other than GET method on Canvas Developers Group. 07-14-2022 11:30 AM
- Posted Re: Google App Scripts - URLFetchApp API Endpoint Requests other than GET method on Canvas Developers Group. 07-14-2022 10:30 AM
- Posted Re: Google App Scripts - URLFetchApp API Endpoint Requests other than GET method on Canvas Developers Group. 07-14-2022 10:20 AM
- Got a Kudo for Re: Google App Scripts - URLFetchApp API Endpoint Requests other than GET method. 07-12-2022 09:08 PM
- Got a Kudo for Re: Google App Scripts - URLFetchApp API Endpoint Requests other than GET method. 07-12-2022 10:56 AM
- Posted Re: Google App Scripts - URLFetchApp API Endpoint Requests other than GET method on Canvas Developers Group. 07-12-2022 05:33 AM
- Got a Kudo for Re: API GET request returns an HTML print instead of JSON data @GoogleAppScript. 06-23-2022 06:08 AM
- Got a Kudo for Re: API GET request returns an HTML print instead of JSON data @GoogleAppScript. 06-22-2022 12:20 PM
- Got a Kudo for Re: API GET request returns an HTML print instead of JSON data @GoogleAppScript. 06-22-2022 10:37 AM
- Got a Kudo for Re: API GET request returns an HTML print instead of JSON data @GoogleAppScript. 06-22-2022 06:14 AM
- Posted Re: API GET request returns an HTML print instead of JSON data @GoogleAppScript on Canvas Developers Group. 06-22-2022 05:44 AM
- Got a Kudo for Re: Via REST, how do I obtain a valid role_id list for a subaccount?. 05-23-2022 11:25 AM
- Got a Kudo for Re: API call for getting all SpeedGrader comments for a course?. 05-17-2022 10:28 AM
- Got a Kudo for Re: New Quiz API Timeline. 05-17-2022 08:22 AM
- Posted Re: API call for getting all SpeedGrader comments for a course? on Canvas Developers Group. 05-17-2022 07:58 AM
- Posted Re: Assignment Enhancements | Google Documents Not Correctly Uploading on Assignment Enhancements Users. 05-06-2022 07:34 AM
- Posted Re: How to set a lowest possible grade for quiz on Canvas Developers Group. 05-05-2022 09:08 AM
My Posts
Post Details | Date Published | Views | Kudos |
---|---|---|---|
Hi, ya'll. I'm trying to develop an autograding program for CS labs written in Java in my CS class, instead of just manually inspecting code in Speedgrader. I know there are other autograding program... |
04-13-2018 |
1299 |
2 |
07-14-2022
11:30 AM
Hm. Are you running a test function to test the function with known good values on your beta instance? So something like this: function test_enroll() {
enrollUserByURL(<known good user id>, <known good test course id>)
} Because I copied and pasted your code, replaced the URL and token with my values, and ran it and got the same result as my function. So I'm not exactly sure what is different between my environment and your environment.
... View more
07-14-2022
10:30 AM
Are you adding "/api/v1/" to your Canvas URL for your institution? So it should look like: school.instructure.com/api/v1/courses/ followed by the rest of the endpoint.
... View more
07-14-2022
10:20 AM
I think you're missing the "Content-Type" parameter, I used 'multipart/form-data'. Code is below. Hope this helps! function enrollUser(user_id,course_id) {
var requestURL = <canvas URL> + course_id + "/enrollments?enrollment[user_id]="+user_id+"&enrollment[type]=StudentEnrollment"
var options = {
'muteHttpExceptions': true,
'method': 'POST',
'Content-Type': 'multipart/form-data',
'headers': {
"Authorization" :"Bearer "+ token,
},
};
var result = UrlFetchApp.fetch(requestURL, options);
Logger.log(result);
}
... View more
07-12-2022
05:33 AM
2 Kudos
Hey! Glad that someone is working with Google App Script! So unfortunately for the Enrollments endpoint, you actually need to write the parameters in the URL as query parameters instead of sending a payload. The message actually hints at this solution but I totally understand getting confused by it. Your URL will look something like this: "<CANVAS_URL>/api/v1/courses/" + course_id + "/enrollments?enrollments[user_id]=" + user_id + "&enrollments[type]=StudentEnrollment" And you'll not have a "payload" key in the JSON object for options. I tried this in my beta environment and it worked, returning the Enrollment object. I believe (and correct me if I'm wrong) the cURL command examples can give you a hint as to where your parameters go. If you see "-F" that means that it's probably going to go in the url, and if you see "-d" then that is going to go into the payload. Good luck!
... View more
06-22-2022
05:44 AM
4 Kudos
Hi, Tamas. I think there are two things going on here that might be affecting the output. 1) A GET request shouldn't need a payload parameter. The options object should only have method, header, and muteHttpExceptions. 2) You should JSON.parse() directly the item returned by fetch function. See if this gets you going. Good luck!
... View more
05-17-2022
07:58 AM
1 Kudo
You need to do multiple API calls and process the results to call the next API endpoint. First, you need to retrieve all assignments from the course: https://canvas.instructure.com/doc/api/all_resources.html#method.assignments_api.index Then, given that list of assignment IDs retrieved from the JSON object, you will call the submissions endpoint for each assignment: https://canvas.instructure.com/doc/api/submissions.html#method.submissions_api.index with the include[]=submission_comments parameter. Then once you have those JSON objects you can process the submission comments. Hope this helps!
... View more
05-06-2022
07:34 AM
Hi, was the hotfix deployed @jsailor? I checked this morning with Assignment Enhancements on and I'm still getting the unintended behavior when attaching a Google document.
... View more
05-05-2022
09:08 AM
You can utilize the API to traverse the quiz grades. Try https://canvas.instructure.com/doc/api/submissions.html#method.submissions_api.update Not sure if this works on New Quizzes. They're an external tool so I don't think the API can get into New Quizzes.
... View more
04-27-2022
04:43 AM
2 Kudos
Could you post the API endpoint that you called to make these screenshots?
... View more
04-26-2022
12:23 PM
2 Kudos
Hi! I actually am running a Python script to automate a similar process (we want to know how many logins we're seeing at each school and on what days to see trends), so I know it can be done.
If you just want users with 0 activity, there's a report for that -- it's called "zero_activity_csv" and you can call it from this endpoint:
https://<canvas>/api/v1/accounts/1/reports/zero_activity_csv
See more info here: https://canvas.instructure.com/doc/api/all_resources.html#method.account_reports.create
This endpoint for running reports I believe can accept any report that you can run from the UI, you just need to know the name of the report.
You can grab the last login for a student using this endpoint:
https://<canvas>/api/v1/accounts/:account_id/users?include[]=last_login
See more info here: https://canvas.instructure.com/doc/api/users.html#method.users.api_index
If you need full login details, you can try
https://canvas.instructure.com/doc/api/authentications_log.html#method.authentication_audit_api.for_login
to retrieve all logins for a user.
I'm not familiar with your SIS so I don't know if these will work via the SIS, but as long as your SIS can do HTTP get requests it can be done. Otherwise, you can script using any language you like and make it a cron job/task scheduler job.
Good luck!
... View more
- Tags:
- api
04-26-2022
11:16 AM
I think you have the gist of how the program works. API calls are paginated, so you'll have to deal with that as well 🙂
In order to help with code it would be great if you could reply back with the languages of choice that you are most familiar in.
... View more
04-22-2022
07:31 AM
2 Kudos
I figured it out -- you probably have more than 10 roles in that subaccount (there are some roles like Quizzes.NEXT service, SIS account roles for SIS imports, etc) --
query this URL and they should all pop up:
https://herzing.instructure.com/api/v1/accounts/224/roles?show_inherited=true&per_page=100
By the way, most API calls are paginated calls -- meaning it returns the first 10-20 results. If you add the per_page parameter to the call, you can get X number of results (I usually keep it at 100 then call the next page when needed).
Hope this helps!
... View more
04-20-2022
05:46 AM
1 Kudo
Have you tried adding the parameter show_inherited to the query?
So it would look like:
https://herzing.instructure.com/api/v1/accounts/224/roles?show_inherited=true
... View more
04-15-2022
04:33 PM
3 Kudos
Hi, @bludlow and @jsailor
I am also seeing this behavior with Google Assignments LTI 1.3 and I'm glad I encountered this thread -- I tried to contact Canvas support but got directed to talk to Google support (twice), and now I'm stuck trying to explain to Google support what the issue is (it's been a week of back and forths and Google now thinks it's a network issue and not their tool...ugh).
Please let me know what I can do to help guide this along (if anything). It's frustrating for teachers right now when they're trying to grade assignments. I've been directing teachers and students to submit a Google Doc URL but they really want the old functionality back 🙂
... View more
04-11-2022
06:00 AM
If you're using Postman, you can use a Collections Runner. https://learning.postman.com/docs/running-collections/intro-to-collection-runs/
If you know some JS you can also write a script directly in Postman. https://learning.postman.com/docs/writing-scripts/intro-to-scripts/
I highly recommend writing a script for this, though, like James suggests.
Good luck!
... View more
04-07-2022
05:02 AM
1 Kudo
Hi, @FrancisPark.
You could try this tool here: Northwestern U -- Add quiz questions by converting CSV to QTI (the tool itself is made by Kansas State but these are Canvas specific instructions). I haven't used the tool myself so I can't say if it works for your use case. I would suggest creating a "sandbox" course and uploading the result there so you can see if the tool works for you.
Alternatively if you have experience with the Canvas API/REST API and some programming knowledge you can create your own template and use the API calls to create the quiz and questions from reading the CSV file. If you go this route and you need help, there's a Canvas Developers Group that can help with any issues using the Canvas API.
Good luck!
... View more
04-06-2022
05:31 AM
1 Kudo
@PaulJanzen -- There's some updates on the New Quiz API here Current status of New Quizzes API - Instructure Community ...looks like they're working on it.
As far as I know there are no endpoints for New Quizzes yet.
... View more
04-04-2022
08:07 AM
1 Kudo
@chadscott
Hey, Chad! Thank you so much for the writeup!
We're doing something similar at my district (Charlotte Mecklenburg Schools) that I do have code for that I'm willing to post & share if anybody would like it in Python. I use the CanvasAPI wrapper plus some Python magic to get it working (and direct calls to the REST API instead of a SIS import but now that I'm looking at this I'm wondering why the heck I didn't do a SIS import! It may be because we have a lot of campuses LOL)
Just some thoughts/questions:
1) If a student changes grade levels mid-year does this code account for that?
2) Just curious, is there a reason why the counselor course & the student "class of" courses couldn't be combined?
3) How long does it take for the SIS import to complete?
... View more
03-31-2022
06:00 AM
2 Kudos
@hess The "include[]=submission" parameter only returns submissions for the current user -- which would normally be you since you're using your API token to access that submission.
See documentation here: https://canvas.instructure.com/doc/api/assignments.html#method.assignments_api.index
I would use @James 's suggestion to masquerade in order to get the status of a submission for the current student. https://canvas.instructure.com/doc/api/file.masquerading.html
... View more
03-28-2022
07:32 AM
@skeesler I'm not 100% sure but there seems to be a "custom user data" endpoint located here: https://canvas.instructure.com/doc/api/all_resources.html#method.custom_data.get_data
The data may be there.
Unfortunately my instance doesn't have Faculty Journal entries so I can't confirm. In addition, it looks like you're using the CanvasAPI Python wrapper...which doesn't have a method for getting this custom data (as far as I know). You may have to use a HTTP library to make the calls yourself.
... View more