Phone Number to SIS User File

Jump to solution
akinsey
Community Contributor

Question: is there a way to add a phone number to the SIS User File Import so that a student's phone number can be pulled from the SIS and added to the Ways to Contact under their User file. I'm sure there's a possiblity of a way, but I'm uncertain what the field name needs to be.

Any thoughts? ideas? successes?

Thanks!

1 Solution
James
Community Champion

 @akinsey ,

Phone number is not an allowed field in the users.csv SIS import. Neither are what contact methods can be used.

The only place that phone is mentioned in the API is as an example for the Store custom data endpoint. You could write some custom code that would pull that out and display it, but it is definitely not a core component of Canvas. You might even add a button through the custom global JavaScript that would look up the phone number. You might even be able to get it to send a text to that message as an admin, but if it's not registered as a communication channel, that would most likely involve something outside Canvas.

SMS is available as a notification, and that's the channel that is listed under the Profile page when you list ways to contact. Automatically adding texting without their consent as a communication channel could be problematic (possibly legally but definitely not a nice thing to do to the users) but it can be done through the Communication Channels API.

If automatically setting up students to receive notifications weren't bad enough, sharing their cell phone numbers with everyone and telling people it's okay to contact them that way certainly opens doors you probably don't want opened. This is connected to the "Let fellow course/group members see which services I've linked to my profile" option from the Profile page, but that option is enabled by default.

Even if you have looked at all the downsides of doing this and decide you want to proceed, you're running into some technical issues at this point. The call to update the profile and set the ways to contact is not an API call. It's a PUT to <instance>/profile/update_profile that is made as the user. There's actually a bug in it right now, a malformed request (see the first google_drive with the missing closing bracket), but it still worked.

249641_pastedImage_1.png

Sometimes the calls made by the Web UI are duplicated with the API, but not always. I like to go check the mobile apps when I'm questioning the existence of an API call. After I've looked high and low and can't find it, I go to the Canvas app. If the ability to accomplish what I want is there, then I am pretty sure there's an API call for it. If the ability to do what I want is noticeably missing (other things are there, but not that one thing), then Bayesian probabilities kick in and the chance of the API call existing just took a nosedive.

You can use a headless browser to make non-API calls. I'm not sure how that would work here since you need to be the user (I don't know if as_user_id works with non-API calls), you might have to masquerade as each user, agree to the (soon to be) "Act as user" page, then make the call. In the past, I've used CasperJS that called PhantomJS to act as a headless browser, but with Chrome 59 that came out in June 2017, you can now run a headless chrome. I have not looked into that enough to know whether it is a viable alternative or not.

Finally, when you wrote

I'm sure there's a possiblity of a way

was that because you have heard or seen someone do this, because you're being optimistic, offering the common "I'm sure it's simple but I can't find it", or something else? As you can probably tell from my post, I'm not convinced there is a way -- at least one that's easily accomplished -- and kind of glad that there's not.

View solution in original post