Adding attributes to links in returned HTML snippets to make it easier for API consumers to dig

Community Participant

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:

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).


<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]">


<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.









Labels (1)