GET all courses, not just ones I'm enrolled in
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2020
08:25 AM
Hi,
I have an admin account.
When I use the courses endpoint (Courses - Canvas LMS REST API Documentation ) the response only includes courses I am a member of (as teacher, student, etc.)
How can I get detail of all the courses on my instance please?
Example code (python):
courses = []
pagesize = 5
queryterms="?per_page="+str(pagesize)+"&&exclude_blueprint_courses=true"
uri = 'https://awsacademy.instructure.com/api/v1/courses'+queryterms
r = requests.get(uri, headers=headers)
raw = r.json()
for course in raw:
print(course['name'])
courses.append(course)
while r.links['current']['url'] != r.links['last']['url']:
r = requests.get(r.links['next']['url'], headers=headers)
raw = r.json()
for course in raw:
courses.append(course)
print(course['name'])
print(len(courses))