Register for InstructureCon25 • Passes include access to all sessions, the expo hall, entertainment and networking events, meals, and extraterrestrial encounters.
Found this content helpful? Log in or sign up to leave a like!
Hi,
I'm writing a bit of custom JS to add to our Canvas theme in order to interact with some web services we've got running.
To get it working correctly I need the user's SIS id, which I was getting from the api (api/v1/users/self/). this seemed to be working fine, but I've just noticed the "sis_user_id" is not being included in the response when the user is not an admin. As an admin I can see it for "self" and also for the students, but their "self" calls don't include it.
I'm guessing this is permission based but can't seem to find a place to allow it. Admins have "SIS Data - read" in the Account Roles. I've tried permitting it for the student Course Role, but I think that's only giving me the course sis id but not for the user.
Any ideas would be greatly appreciated !
Can you access the SIS id if you use the course-user method? I can't access the api/v1/users/self in my instance, but /api/v1/courses/:course_id/users/:id shows me the other user's sis_user_id.
Source: https://canvas.instructure.com/doc/api/courses.html#method.courses.user
Correction, I can access api/v1/users/self , and it does not show my sis_user_id. What I meant was that I could not access other users through the api, except through the courses, as mentioned above. And that method does show me my own sis id.
Thanks Gabriel,
In fact I only want the user to retrieve their own SIS id for an api call to another system. There doesn't seem to be any way for a student to get that. The course api works, but only if I allow reading other students SIS ids..
@curtisvo The data for a user is located at the root account level, and as such, Canvas will check the permissions at the root account level to see if the user is able to read the SIS data (the SIS ID in this case). Enabling the permission at the course role level just lets the course role see the SIS data within a course. You can see more details on how the SIS Data - read permission works here.
@Gabriel33's solution may work if you're able to pull what course the user is in and you allow users to see everyone in the course (which may violate institution policy).
Just curious, is there another way to pull a user's SIS ID or construct it using known information? I know some K-12 districts have their SIS IDs structured in a way to identify students based off their ID number and a prefix/suffix, so even if you can't pull the SIS ID directly it can be constructed using login ID, as an example.
Thanks for your response @melodyc_lam ! That documentation and permissions explanation is useful
Indeed, enabling SIS Data - read at the course level won't be acceptable due to exposing other users' ids. Otherwise it might have worked.
Unfortunately I'm not seeing any way to allow a student to retrieve their own SIS id, and our SIS ids are not derived from any other student information so it looks like I'll have to rethink my approach.
To interact with Panda Bot in the Instructure Community, you need to sign up or log in:
Sign In