Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
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.
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.
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):
Hi Fernando,
It does not look like the there is any specific identifier for course card in either Canvas Data or the API. It is a file and uploaded as an attachment with the Course context.
The file shows up in file_dim, with a folder ID, but I didn't select a folder. So I looked in the Course files and found one called course_image, it can contain 1 or more images. Canvas Data doesn't seem to contain any references to folder names, which means there is no way to query WHERE folder_name = 'course_image'
You could, possibly shoot for all something like
SELECT folder_id FROM CanvasLMS.dbo.file_dim WHERE owner_entity_type = 'course'
Files - Canvas LMS REST API Documentation
Then, do an API lookup for each folder_id, and get the name of each, which is commonly
course files/course_image
store the folder name, or flag the file as a possible course card (could be multiple files in the folder, maybe versions?)
Or...
If you have control or communication, naming conventions would make it a snap with a standard file name or prefix to the file name.
Since you'd have to go through the API to get the actual file, it might just be easier to use the API for the majority of the task and skip CD. Or use CD to get the courses for your report, then loop through courses, getting each folder, and getting the files in the course files/course_image folder.
Jive ate your reply. I'm anxiously waiting to see if you found another way.
I've never had Jive do that completely before -- at least not that I remember. I thought for a minute my Internet had gone out, but everything else was working).
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.
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):
that is the answer that help us to get the url of courses cards! Very thank you
To participate in the Instructure Community, 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.