Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
Found this content helpful? Log in or sign up to leave a like!
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))
Hey @smartps ,
Try https://awsacademy.instructure.com/api/v1/accounts/1/courses as your endpoint instead.
Relevant page in the documentation:
To participate in the Instructure Community, you need to sign up or log in:
Sign In