Activity Feed
- Got a Kudo for Re: Does a self-enrollment account report exist. 09-13-2022 01:06 PM
- Got a Kudo for Re: Basic Call to API displaying courses?. 08-06-2020 01:59 AM
- Got a Kudo for Re: Observees' Grades. 08-06-2020 01:59 AM
- Got a Kudo for Re: Get List of Import Content Queue Status. 08-06-2020 01:59 AM
- Got a Kudo for Re: "Edited By" field on events and/or assignments. 08-06-2020 01:59 AM
- Got a Kudo for Re: Retrieve students' name associated to courses as observer. 08-06-2020 01:59 AM
- Got a Kudo for Re: When getting a list of user objects via the API why is integration_id not included? or is there a way of including all properties in this returned user object?. 08-06-2020 01:59 AM
- Got a Kudo for Re: "Edited By" field on events and/or assignments. 08-06-2020 01:59 AM
- Got a Kudo for Re: When getting a list of user objects via the API why is integration_id not included? or is there a way of including all properties in this returned user object?. 08-06-2020 01:59 AM
- Got a Kudo for Re: Find if user is root account admin. 08-06-2020 01:59 AM
- Got a Kudo for Re: Why is the gap between the H3 bigger than all the others?. 08-06-2020 01:59 AM
- Got a Kudo for Re: Basic Call to API displaying courses?. 08-06-2020 01:59 AM
- Got a Kudo for Re: Programming. 08-06-2020 01:59 AM
- Got a Kudo for Re: Batch upload quiz instructions. 08-06-2020 01:59 AM
- Got a Kudo for Re: Create a User API Issue. 08-06-2020 01:59 AM
- Got a Kudo for Re: Batch upload quiz instructions. 08-06-2020 01:59 AM
- Got a Kudo for Re: Last Course Created?. 08-06-2020 01:59 AM
- Got a Kudo for Re: REST - How to retrieve Enrollment Term "overrides"?. 08-06-2020 01:59 AM
- Got a Kudo for Re: Does a self-enrollment account report exist. 08-06-2020 01:59 AM
- Got a Kudo for Re: Dont's in Canvas?. 08-06-2020 01:59 AM
My Posts
Post Details | Date Published | Views | Kudos |
---|---|---|---|
What IP ranges do you need to allow for a locked down server to use the Canvas API without issues? Hello, I have a standalone server that regularly makes API requests to our Canvas instance (us-east-1) to launch reports, then eventually download them when they are complete. On this server we have ... |
02-22-2018 |
1017 |
0 |
02-22-2018
02:02 PM
Hello, I have a standalone server that regularly makes API requests to our Canvas instance (us-east-1) to launch reports, then eventually download them when they are complete. On this server we have had several issues with the script timing out if running it as a batch. Now Amazon has a JSON reference that tells you which IP ranges belong to which region, which is great. However for Canvas, is it necessary to allow all of the ranges? There are apparently three different services: AMAZON, S3 (used for reports if I remember correctly), and EC2. Thanks for your help.
... View more
04-13-2017
08:24 AM
1 Kudo
I would start by checking all the CSS (not just overrides) Canvas is using. This can be done by viewing Developer Tools in Chrome, or Firefox. Look for all instances of referenced stylesheets, and maybe compare styles targeted for mobile and desktop.
... View more
04-12-2017
10:17 AM
1 Kudo
Are you calling this in your browser or in a script? If using a script you may need to grab the overrides field from $termObject . enrollment_terms . overrides The browser should just list the overrides.
... View more
04-10-2017
08:51 AM
1 Kudo
Personally so far I have only had to grab element classes that only applied to specific pages (i.e.: login and confirmation buttons). I do this using Chrome's developer tools, but I am not sure where you would find a class cryptically named as such. Most of the element classes I have come across are conveniently named (menu-item, ic-app-header__menu-list-item, etc).
... View more
04-06-2017
08:26 AM
5 Kudos
Hi there, Not sure if you arrived at a solution yet, but you can just get the announcements in just one API call without having to filter them. As you mentioned you can pass the "only_announcements=true" argument in your query string, which should only return announcements and no discussions. GET https : / / school . instructure . com / api / v1 / courses / : course_id / discussion_topics ? only_announcements = true You can store those announcements in an array, then loop over them (you will only need the ID attribute), then pass the array to the DELETE call.
... View more
03-27-2017
09:17 AM
2 Kudos
Hi there, As dgrobani mentioned, the Content Migrations API is what you are going to want to do. To iterate through multiple courses, a for-loop inside a script should accomplish what you need. Simple PowerShell example: # OAUTH key $auth = "<auth key>" # If you want to hard code an array of course IDs $courseIDs = @ { '1' , '2' , '3' , '4' } # If you want to import a list of course IDs in a text file # $courseIDs = Get-Content C:\Temp\courseids.txt foreach ( $c in $courseIDs ) { Invoke - RestMethod " https://school.instructure.com/api/v1/course/$c/content_migrations " }
... View more
03-06-2017
12:15 PM
1 Kudo
What REST calls are you using to get the student names? Would you be able to provide a sanitized version of the commands used? It may be worth looking into the Enrollments API or the Courses API.
... View more
03-06-2017
12:12 PM
2 Kudos
First, you would need to extract the Canvas IDs the observer is observing. A PowerShell snippet would look something like: $ids = Invoke - RestMethod " https://school.instructure.com/api/v1/users/:canvas_id_of_observer/observees " - method get - headers @ { "Authorization" = "Bearer $auth" } | % { $_ . id } Foreach ( $i in $ids ) { invoke - restmethod " https://school.instructure.com/api/v1/users/$i/enrollments " - method get - headers @ { "Authorization" = "Bearer $auth" } | % { $_ . grades } }
... View more
02-28-2017
01:41 PM
1 Kudo
This makes sense, and yes it appears account admins (myself included) would be able to see this field. Whether this is limited to account admins I do not know but it is a start.
... View more
02-28-2017
12:59 PM
1 Kudo
Hi there, Are you sure? Whenever we call the following GET method: GET https://school.instructure.com/api/v1/accounts/self/users We get the following fields by default: id name sortable_name short_name sis_user_id integration_id sis_login_id sis_import_id login_id
... View more
02-21-2017
07:13 AM
3 Kudos
Easily enough, all you need is the Admins API endpoint. This will list all admins for whichever account you need to query (in this case just add the root account ID). GET /api/v1/accounts/:account_id/admins You can also pass the user_id[] parameter to the query string if you want to see if the user in question exists as an admin under that account. https : / / school . instructure . com / api / v1 / accounts / self / admins ? per_page = 100 Edit : A PowerShell example to get AccountAdmins ONLY : $res = invoke - restmethod " https://school.instructure.com/api/v1/accounts/self/admins?per_page=100 " - method get - headers @ { "Authorization" = "Bearer $auth" } foreach ( $r in $res ) { if ( $r . role - like "AccountAdmin" ) { $r } }
... View more
02-16-2017
12:37 PM
1 Kudo
Can you post a sanitized version of the code?
... View more
02-16-2017
10:13 AM
3 Kudos
"Ping" may not be the best word to describe what you are trying to accomplish here.You can most likely work off of whichever course ID has the highest value. In this case you would need to get the last "page" of courses to help narrow your results. Here is a PowerShell example: USING CANVAS API: $res = invoke - webrequest " https://school.instructure.com/api/v1/accounts/self/courses ?" - method get - headers @ { "Authorization" = "Bearer $auth" } $res . headers . link Then check the last bit of output. You should see something like /api/v1/accounts/self/courses?page=11000&per_page=10>; rel="last" The next step would be to make an API call on that last page. Invoke - WebRequest " https://school.instructure.com/api/v1/accounts/self/courses?page=11000 " - method get - headers @ { "Authorization" = "Bearer $auth" } THROUGH CANVAS GUI: The other option is to run a Provisioning report for courses. When the report is finished, download it, open it in Excel, then sort the courses based on the canvas_course_id.
... View more
02-16-2017
09:57 AM
3 Kudos
Hi there, There are a few questions we need to address first. What is your role inside Canvas? Are you an admin, instructor, or student? Do you just need the JSON response containing the list of courses or do you have a web page that makes the API call?
... View more
02-14-2017
11:56 AM
2 Kudos
You're welcome! I actually just now found out that you CAN edit a quiz that is already there. I believe you have to put the editing parameters inside the header, not the body. You can do this inside the query string. A PowerShell example would be: Invoke-RestMethod " https://school.instructure.com/api/v1/courses/:course_id/quizzes/:quiz_id?quiz[description]=These%20are%20the%20instructions%20for%20the%20quiz " -method put -headers @{"Authorization" = "Bearer $auth"} Let me know if you have any questions.
... View more
02-14-2017
11:38 AM
3 Kudos
Hi Patrick, Oddly enough, I cannot seem to be able to just "add" instructions to a quiz that already exists. If I try to edit the quiz this way, the description doesn't change for some reason. I found that I can do this only if I am creating the quiz in the same step. Using the following logic should work if you do not have the quizzes uploaded already: POST /api/v1/courses/:course_id/quizzes/ BODY quiz[title] = "Quiz A" quiz[description] = "These are the instructions for the quiz" You can write a loop that creates multiple quizzes and just inserts these instructions as they are created. Sorry if this does not resolve the issue entirely.
... View more
01-24-2017
08:32 AM
5 Kudos
I was going to suggest this. It doesn't seem that the API call for listing all courses inside an account (see below) supports returning the self enrollment attribute. GET /api/v1/accounts/:account_id/courses Instead loop through all the course ids with the following API call: GET https://school.instructure.com/api/v1/accounts/:account_id/courses/:course_id?include[]=self_enrollment
... View more
01-24-2017
07:29 AM
2 Kudos
This API endpoint is still in beta. Certain functionalities and limitations like what you are experiencing may occur. I am curious about this endpoint and will look into it more. Update: While it may seem obvious, a question group must first be added to the quiz, then individual questions need to be added to that group. If a question is added to a quiz outside of a question group, the quiz_group_id will always be null. Update2: The first call you mentioned may be the closest thing in terms of getting the quiz group ids GET /api/v1/courses/:course_id/quizzes/:quiz_id/questions Assuming every quiz group created is being used, you can loop through all of the questions and get the distinct quiz group ids. Of course this will require extra data massaging. I hope this helps.
... View more
01-05-2017
06:45 AM
2 Kudos
To follow up on this, I was able to generate an API key with my student (non admin) account, and perform the following: GET https://school.instructure.com/api/v1/courses/:course_id/quizzes/:quiz_id/submissions I did not get any thrown errors letting me know I was unauthorized to make that API call. When invoking this call as a non-admin it returns your assignment submissions only. You can still obtain an API key by going to Account --> Settings --> New Access Token. Then, for each API call you need to pass that API key in your request header.
... View more
01-03-2017
11:12 AM
3 Kudos
401 usually means you are unauthorized to run the command. The API call you are wanting to invoke returns assignment submissions for all users that participated in that assignment. Somebody correct me if I am wrong but you will need admin rights to make this call. Edit: To better answer your question, yes you will need a key to make this API call.
... View more