cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer III

How do you generate a list of email addresses from a course roster?

Jump to solution

I frequently have the need to grab the email addresses of all students in a particular course.

My current workflow in this situation is to create a new sub-account, move that course into the sub-account, and run a user sis export from that sub-account.

Afterward, I'll move the course back up an account level and delete the sub-account.

Anyone know an alternate or easier way of doing this?

1 Solution

Accepted Solutions
Highlighted
Surveyor

I just found a way to complete this task very easily.  If you enable Analytics Beta and download the report, a list of email addresses is included in the .csv.

Download button in Beta Analytics

View solution in original post

9 Replies
Highlighted
Community Coach
Community Coach

milesl@berkeley.edu​, to try and garner more responses to your question I'm going to share this with the Canvas Admins​ and Canvas Developers​ groups in the Community.

In general I've never had a need to get all email addresses from all students in a particular course, but if I did I'd probably start with our Student Information System (SIS) because that information is readily available there. If I was trying to do it through Canvas, I'd copy and paste the People table from the course into excel and use the NetID to generate the list - for us student's NetID is the first part of their email address, I'd just need to add the @richland.edu to each and I'd be good to go.

Highlighted

Thanks, Kona. I wish our student IDs mapped to email addresses!

I guess starting with our SIS is a good idea, but it would be nice if there was a way to do it straight from Canvas, since all the info is there.

Plus, I'm often grabbing a subset of users based on info from Canvas (e.g. emails of all students who have not yet logged in).

Highlighted
Community Coach
Community Coach

I agree with you, kona@richland.edu​.  If our instructors need to be absolutely sure that a message is getting sent to students, I usually recommend that they grab the student e-mail addresses from the instructor's class roster in our SIS (Student Information System), Banner.

Highlighted
Surveyor

I was trying to learn a little PHP to interact with the Canvas API and in my Googling ran across this:

--https://github.com/drlippman/canvas-scripts/tree/master/API

Dr. Lippman's 'liststudent.php' code was very instructive to a PHP/CanvasAPI newbie, and you could pull both email and sis_user_id's without much trouble.

Highlighted
Navigator

milesl@berkeley.edu,

Moving them to a separate account is a time-consuming and needless step. So let me ask a possibly rhetorical question.

Is the purpose of moving the course to a separate sub-account so that you can 1) obtain just the email addresses for that class or 2) reduce the time it takes for Canvas to prepare the report?

The reason I say possibly rhetorical is because both questions might have the same solution so it doesn't matter.

A quicker way than what you're doing would be to download a SIS or Provisioning Report that contains the enrollments, users, and possibly courses and then use Excel to connect and filter them, similar to the method(s) explained in How to list teachers who have published/unpublished courses

Don't let the title confuse you, it's about combining multiple provisioning reports together in Excel to get the information you really need.

So, you don't need to separate the one course from the rest first, you can do that in Excel.

If it's to reduce the time needed to get the information, it might be easier to break up the work load and request a SIS report and then go work on other things while you wait. Alternatively, since University assigned email addresses rarely change, you might want to request a report once a week and then just use that all week long. But even then, you still need to tie the tables together as explained in the link.

This gives the benefit of being able to generate a list of email addresses for any class relatively quickly. If you need a different course, then change your filters.

Other approaches

If you need a list of email addresses, then I agree that if you have access to the SIS system (some people don't) that it would be a quicker way.

If you can find someone who understands JavaScript, it wouldn't take too much to integrate a couple of scripts I've I written for other tasks to add a button to the People page to download the list of students with their email addresses. The API call is the List users in course and it the call would look like

     api/v1/courses/XXXXX/users?enrollment_type[]=student&include[]=email&per_page=100

That page will give you the name, sortable name, SIS user id, SIS login, Canvas login, and email address. You can then export those to a CSV file.

The per_page parameter reduces the number of network calls, but you still need to allow for pagination since there might be more. Large classes will be really slow and I need to rewrite some of my code to think in parallel instead of serial to speed them up - but they work and I've got other things I can do while I wait.

The scripts to combine aren't the obvious ones. I've got a download roster script that downloads it as a PDF or even makes a Photo Roster, but those only use the information on the page, which don't include the email addresses unless those are your logins (some schools do that). It does, however, download them in the order they're in on the page and I've got the ability to sort by any column there, so you could sort by last activity or total activity.

There is a List recently logged in students API call, but it doesn't give their email address.

The script that comes closest to what you want is probably Obtaining and using Access Report data for an entire course . It adds a button, gets a list of students, fetches information about each student, and then exports it as a CSV file. You could cut out the fetching information about each student part -- unless you want to include some other information like login. Basically, your request would be a slimmer version of that one.

If you don't want a button added to the page, you could modify one of my Google Sheets to collect the information. That might be more useful for an Canvas administrator so they don't have to go into every course.

What is the purpose?

But what hasn't been addressed is how the email addresses are going to be used.

Sometimes, if we know what the end game is, we can suggest a better path. For example, some people think to get from point A to D, you have to go A -> B -> C -> D because that's the only way they're familiar with and that's how they did it with another LMS. With Canvas, it might be possible to go A->Z->D or even X->D by starting in a different place. While the intuitive place might be to start with a course roster, it might be easier to download a report.

If the email addresses are needed to communicate with the students ...

If you just need the email addresses so you can email the students, it's probably easier to just send a message to those students.

If you need email addresses that students monitor ...

At our institution, if you want email addresses that students don't use, then by all means -- go to the SIS or append the domain to the NetID which can be obtained from the roster page.

However, if you want email addresses that the students actually read, then those are not contained in the SIS, they're contained in Canvas, but they're not available through the roster page or the enrollment APIs. You can get them through the Communication Channels API or Canvas Data in the communication_channel_dim table (joined with the user_dim table to pull out name information)

If you need customized messages ...

If you need customized messages to go each student, then it may be worth looking at the Conversations API so you can send a message to each student within the Canvas framework and then let the student decide where to receive it through their preferences.

This would require programming skills to implement.

If the email addresses are needed by an external application ...

In this case, you need the email addresses and they are probably the ones in the SIS and not the alternative ones that are actually read by the students. Here you could use some of the methods listed above.

Highlighted

James Jones Thank you for your thorough API Request information both here and on another page I visited yesterday. Using what you shared, I was able to piece together a solution for my situation and figured I ought to share it to benefit the community. Applying your API request to the URL looks something like this:

https://canvas.institution.edu/api/v1/courses/XXX/users?enrollment_type[]=student&include[]=email&pe...

To modify this to your case there are three things to know:

  1. canvas.institution.edu needs to be your organization's page
  2. XXX needs to be the course number
  3. If there are more than 100 students, you increase the page value at the end of the URL to get the next 100 students.

You can leave out the "while(1);" from the beginning of the JSON code, copy the rest, and paste it into a converter.

P.S. If there are more than 100 students, replace the ending hard bracket with a comma and add the next page's results to the string before running the converter to get it compiled into a single document.

Highlighted

scain@unl.edu

I'm glad you were able to get what you needed.

If you use the API through a programming language, you won't need to worry about the while(1); business. That just shows up when you call it through a browser. There are browser extensions you can use that will bypass that, but it warns that some pages may stop working (people linking to a Google Doc was one of those areas), so I stopped using it.

Also, if you're using a program, there is a Link header that will contain the links to the next page of results, but yes, it's basically the same thing you've figured out. The nice thing about it is that it will let you know whether or not there is another page. If, for example, you have exactly 100 students, you would not know whether or not to retrieve another page the way you're doing it.

The method of joining the JSON responses together worked for me until I started working with Outcomes this summer. Then I had to combine the records in different ways because they didn't get returned the same way everything else I've encountered did, but when it works, combining them together like you did is the easy way.

What you're doing is essentially the process I've sued for many things, just doing it completely from within the browser rather than having to write code. So kudos to you for showing people how it can be done without writing code.

Highlighted
Community Coach
Community Coach

milesl@berkeley.edu​,

Were you able to find an answer to your question? I am going to go ahead and mark this question as answered because there hasn't been any more activity in a while so I assume that you have the information that you need. If you still have a question about this or if you have information that you would like to share with the community, by all means, please do come back and leave a comment.

Robbie

Highlighted
Surveyor

I just found a way to complete this task very easily.  If you enable Analytics Beta and download the report, a list of email addresses is included in the .csv.

Download button in Beta Analytics

View solution in original post