RanjeetSingh
Community Member

List external tools does not return data for courses

Jump to solution

I'm working on a report to find which LTIs have been enabled on which courses, but GET /api/v1/courses/:course_id/external_tools is returning a blank array.  I can get LTI data using the accounts endpoint with various account ids, but no such luck with courses.  Has anyone else run into this problem?  Here's some more specific information in case it's helpful:

Working:  GET /api/v1/accounts/110/external_tools -> returns status_code 200 and a bunch of LTI data

Not working:  GET /api/v1/courses/20678/external_tools -> returns status_code 200 and '[]'

Labels (2)
0 Kudos
1 Solution
matthew_buckett
Community Contributor

Hiya @RanjeetSingh

When inside a course you can add the `include_parents` parameter as documented on: https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.index

For example as (course ID of 20678):

https://instance.intructure.com/api/v1/courses/20678/external_tools?include_parents=true

However this just lists the tools that are "available" in a course, when you say "enabled" what do you mean? You can select an LTI tool to be available in a course but the navigation to be hidden by default, if so then you can use the Tabs API to see which tabs have been enabled in a course:

https://canvas.instructure.com/doc/api/tabs.html#method.tabs.index

If you are wanting to see which courses have added custom LTIs to the site then using the LTI account report is the best way to see which courses have added their own APIs as it allows you to get all LTIs in one request:

https://community.canvaslms.com/t5/Admin-Guide/How-do-I-view-reports-for-an-account/ta-p/109

if you need to run this report through the API then its documented on:

https://canvas.instructure.com/doc/api/account_reports.html

For LTI 1.1 tools it's common to configure tools in accounts and also in courses, however for LTI 1.3 tools it's only possible to configured tools in the root account (as a Developer Key), but then they can be added to courses and accounts.

View solution in original post

4 Replies
matthew_buckett
Community Contributor

Hiya @RanjeetSingh

When inside a course you can add the `include_parents` parameter as documented on: https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.index

For example as (course ID of 20678):

https://instance.intructure.com/api/v1/courses/20678/external_tools?include_parents=true

However this just lists the tools that are "available" in a course, when you say "enabled" what do you mean? You can select an LTI tool to be available in a course but the navigation to be hidden by default, if so then you can use the Tabs API to see which tabs have been enabled in a course:

https://canvas.instructure.com/doc/api/tabs.html#method.tabs.index

If you are wanting to see which courses have added custom LTIs to the site then using the LTI account report is the best way to see which courses have added their own APIs as it allows you to get all LTIs in one request:

https://community.canvaslms.com/t5/Admin-Guide/How-do-I-view-reports-for-an-account/ta-p/109

if you need to run this report through the API then its documented on:

https://canvas.instructure.com/doc/api/account_reports.html

For LTI 1.1 tools it's common to configure tools in accounts and also in courses, however for LTI 1.3 tools it's only possible to configured tools in the root account (as a Developer Key), but then they can be added to courses and accounts.

RanjeetSingh
Community Member

Thank you for that great response, @matthew_buckett !  Adding the `include_parents` parameter gave me all of the available LTIs, as you explained.  From there, I'm able to use the course_navigation, assignment_selection, and other _navigation fields Canvas returns to figure out which LTIs have been enabled on which courses. 

0 Kudos

Hi @RanjeetSingh,

I just want to add some potential clarification here for you and others who might read this thread in the future.  If you're just retrieving the lost of external tools including parents, that's not really going to tell you whether something is actually "used", rather it will just tell you what is configured.  You could take all of the placement info form the list and then crawl through each corresponding areas looking for things configured to use the tool, but that's going to be a lot of work.  As an example, just seeing course_navigation in the list doesn't mean it's being used.  As @matthew_buckett mentioned, you'd need need to look at the tabs api to see if the tab is enabled in the course.  Even doing that can only tell you so much... The tab could be enabled but still not really "used".  I say all this to make sure you're not misinterpreting the data you're getting, especially if you're going to create reports or something based on this.

-Chris

matthew_buckett
Community Contributor

The best way I've found to tell how "much" a LTI tool is being used is to look at the requests table in Canvas Data. This allows you to look at how many users are using an LTI tool each day. However this isn't a good way to compare across LTI tools as different tools have very different patterns of usage (eg tools used by Instructors at the end of term to report results will be very different from a tool used most weeks by most students to answer quiz questions). However it does allow you to roughly look across courses and accounts for patterns of usage (or not being used).

0 Kudos