[ARCHIVED] Hi community. How I can get the course card from canvas data portal? Or some way to get this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are thinking in automatic reports for courses and we need the course card in each report.
Thanks and greetings from Chile!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That was very weird, it looks like entire reply I made to Robert got wiped out when I went to save it. I'll try to repeat as much of it as I can remember.
There are two ways to get a course card image into Canvas. Only one of those shows up as a file ID. Canvas supports Unsplash (used to support Flickr) and file uploads.
I wouldn't use Canvas Data to get it. Besides being out of date, it's problematic as Robert explained and doesn't include those that point to an external site.
The Get course settings endpoint of the Courses API returns three fields.
- image_url is for an external image. Files from Unsplash and Flickr have this property, otherwise it's the empty string.
- image_id is the file ID for a file uploaded to Canvas. Only files uploaded to Canvas have this property set, otherwise it's empty.
- image is a URL that includes any extra parameters (like a JWT token needed to authorize access) to the file and is the one that should be used. This property is set for either technique and it's the one you would want to use with an external program.
If there is no course image, then all three properties are the empty string.
Here are some examples of what you'll get
My wife's flickr image:
My file I uploaded to Canvas (I cut off the image - it was 3 lines long since it has the JWT authorization):
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.