cancel
Showing results for 
Search instead for 
Did you mean: 
agschmid
Community Contributor

API: Inconsistency for enrollment type returned - a bug?

There are a few different ways to get enrollment information for a user and it seems how "type" is returned is not consistent. Not sure if this should be reported as a bug or if we just need to live with the inconsistencies. It complicates things if the type in code for an LTI tool, for example, and in one place you receive "StudentEnrollment" for the type, but in another you receive "student".

Examples (I removed everything between type and roles from the return):

https://canvas.beta.instructure.com/doc/api/courses.html
GET /api/v1/users/:user_id/courses
Course1:
   "type": "student",
   "role": "Instructor-Added Student",
Course2:
   "type": "student",
   "role": "StudentEnrollment",

https://canvas.beta.instructure.com/doc/api/enrollments.html
GET /api/v1/courses/:course_id/enrollments
Course1:
   "type": "StudentEnrollment",
   "role": "Instructor-Added Student",
Course2:
   "type": "StudentEnrollment",
   "role": "StudentEnrollment",

GET /api/v1/users/:user_id/enrollments
Course1:
   "type": "StudentEnrollment",
   "role": "Instructor-Added Student",
Course2:
   "type": "StudentEnrollment",
   "role": "StudentEnrollment",

0 Kudos
1 Reply
pklove
Community Champion

I think we need to live with it.  If it was changed now, it would break things that have already been built using the endpoints.

Inconsistencies in Canvas terminology is just something we have to live with.

How about these:  login_id, Login ID, Secondary ID, SIS Login ID, pseudonym[unique_id]