Hi,
What would be the most efficient way to get the list of students (users with enrollment type = 'StudentEnrollment') from a course object?
Thank you
What language?
List users in course - Courses - Canvas LMS REST API Documentation
<SPAN class="comment token">// jquery</SPAN><BR />$<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ajax</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN><BR /> url<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'/api/v1/courses/:course_id/users'</SPAN><SPAN class="punctuation token">,</SPAN><BR /> method<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'GET'</SPAN><SPAN class="punctuation token">,</SPAN><BR /> data<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN><BR /> enrollment_role<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'StudentEnrollment'</SPAN><SPAN class="punctuation token">,</SPAN><BR /> per_page<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">100</SPAN><BR /> <SPAN class="punctuation token">}</SPAN><BR /><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">done</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN>r<SPAN class="punctuation token">,</SPAN> x<SPAN class="punctuation token">,</SPAN> s<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> console<SPAN class="punctuation token">.</SPAN><SPAN class="token function">log</SPAN><SPAN class="punctuation token">(</SPAN>r<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Thanks so much Robert and James! This helped alot. At the moment I had the file outside of canvas and had a static Json file for testing. Once the Javascript was working the way I wanted, I was trying to fetch the dynamic JSON data from canvas page using the access token to test whether the Javascript still works, but it wasn't. The last part will be to upload the javascript into the theme, for it to fetch data within a canvas page and update in another. Please let me know if this process sounds correct? Will I still need a CSRF token to access pages once the file has been uploaded into the canvas theme?
I don't want to start a new question for this, as it seems mine fits this discussion...
Is it possible to get a list of all students in the system without passing a course_id? I am trying to make a 'tool' that allows administrators to see if a person has a Canvas account by searching for partial name/username across all courses. I know I can loop over course_ids but that seems like a lot more calls. I am not finding an API call that would do this.
I'm currently integrating an LTI tool and attempting to use the Activity.id.history https://canvas.instructure.com/doc/api/file.tools_variable_substitutions.html#activity-id-history variable, but I'm experiencing issues getting it to work properly. What I've Done: Added the Activity.id.history variable to my Developer…
I looked through the LTI Variable Substitutions documentation and while there are variable substitutions available for Canvas.term.name and Canvas.term.id (which is the Canvas incremented ID like "104"), I was surprised to see there was no option for Canvas.term.sisSourceId I tried testing other possible variants that may…
I have a developer key in our Test instance: How would I use this in a local program to make a REST API call? Looking at https://developerdocs.instructure.com/services/canvas/oauth2/file.developer_keys: Developer keys are OAuth2 client ID and secret pairs stored in Canvas that allow third-party applications to request…
I'm building a tool for my institution that imports grades from another LTI tool into Canvas so instructors can automate late assignment policies not otherwise supported by Canvas. I'm trying to use the LTIv1.3 ID which is readily available on the LTI-side as a link to the student record on Canvas, but I can't find the ID…
How can one track Canvas Media use without having the reports available from Canvas Studio? Checking API endpoints and the Data 2 schema, there do not seem to be dedicated Canvas Media endpoints. Am I missing some? A method I've considered is using the body field of the wiki_pages table, as this contains the html code of…