Add New User using API on Canvas Free for Teachers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023
07:19 PM
Hello,
I'm looking to automate inviting users to a Canvas page on Canvas Free for Teachers based on their email address.
I looked at the https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.create API and saw that it takes in a user_id. How would I go about getting or looking for student's user_id based on their email address.
I would think the workflow is similar to us adding students using the web UI?
API call #1: Check if email is tied to a user account
Case 1: User has a Canvas account:
- API call #2 to look up user_id by email address
- API call #3 to send invite using that ID
Case 2: User does not have a Canvas account
- API call #2 to create an account and get ID
- API call #3 to enroll using that ID
Please let me know what I can do. Thank you!