The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Hi all,
Silly question, but I am hoping for examples of use-cases where our users and etc. would find benefit from course designers adding API endpoint attributes to HTML links in their front facing content.
I am referring to something similar to the guide here: https://canvas.instructure.com/doc/api/file.endpoint_attributes.html
We are in the process of updating a bunch of Canvas site front page templates for our faculties to roll out in their courses. In some cases we are already using API endpoint attributes in our HTML links, however, in the majority of cases, our front pages are just purely HTML with no reference to endpoint attributes.
I am trying to find an eloquent way to explain the benefit of adding API endpoint attributes to HTML links to our staff and provide some examples of why it's important and for what purpose(s).
E.g.
<a style="font-size: 1rem;" title="Modules" href="{Your institution's Canvas domain}/courses/{canvas_course_id}/modules" data-api-endpoint="https://{Your institution's Canvas domain}/api/v1/courses/{canvas_course_id}/modules" data-api-returntype="[Module]">
OR
<a title="Class Resources" href="{Your institution's Canvas domain}/courses/{canvas_course_id}/pages/class-resources" data-api-endpoint="https://{Your institution's Canvas domain}/api/v1/courses/{canvas_course_id}/pages/class-resources" data-api-returntype="Page">
If anyone could provide me with some examples of how this data is harvested and by what or whom and why, that would be greatly appreciated.
Cheers,
Phil
I have been doing some experimenting with generating indexes for content in a Canvas course. Thus far I have been working with pages that generally only have references to files in them (typically for images, PDFs, etc.) and I begin by fetching all pages - unfortunately, this means that I also get pages that are not actually reachable from the front page or from any published modules. In reality, what one would really want to do is to only index material that is reachable via the Front page and any visible navigation buttons (as this is the material that should be reachable by a student in the course). This means that as one traverses the graph(s) it is beneficial to know what the endpoint is as the data has a different structure and should or should not be indexed. Without the data-api-returntype one has to pattern match on the URL to know which function to call to decode the data that is returned.
Hi @maguire,
Thank you very much for providing your insight to my query. This now makes a lot more sense, and from your example, will save a fair amount of headache down the track. It also shows me that we there is a lot more we could be doing with our instance of Canvas.
Cheers,
Phil
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.