Community

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ankur_gupta
New Member

Not getting email address of enrolled students from api

Jump to solution

How can i get email address of users enrolled in a particular course. i am using

GET /api/v1/courses/:course_id/enrollments

but the returning array does not contains email address, even user api is not returning email address of students.

Please help me.

Tags (2)
1 Solution

Accepted Solutions
MattHanes
Community Champion

I think you might have to do this with two API calls. Get the enrollments first like you mentioned above and then use the user ids to get the profile for each user:

GET /api/v1/users/:user_id/profile

View solution in original post

6 Replies
kona
Community Coach
Community Coach

 @ankur_gupta ​, because your question is pretty technical, I'm going to share it with the Canvas Developers​ group in the Community. Hopefully someone from there will be able to help!

MattHanes
Community Champion

I think you might have to do this with two API calls. Get the enrollments first like you mentioned above and then use the user ids to get the profile for each user:

GET /api/v1/users/:user_id/profile

When i was using canvas.instructure.com for testing purpose then i was getting email as an index in the returning array  but now when i am using a clients portal https://fsw.instructure.com/ then i am not getting email of enrolled students (using same api for both).

Is there is any setting which i can ask administrator to switch it ON (for email) so that i start getting email address.

Is it possible the token that they provided to you does not have full administrative rights?

The token was generated by administrator from his login. if this will be the reason i will be asking them to generate it again. meanwhile can you tell me how can i make sure that this problem is due to administrative rights of token provided to me. how can i check it?

You can list account admins using this call:

GET /api/v1/accounts/:account_id/admins