Creating & Enrolling new students, via API call
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good Afternoon,
I'm a developer with a "Free for Teachers" account and I'm quite new to the live API. I was wondering how I would go about creating student accounts with student emails via the live API. From what I understand once this is done I can then do a search for the user's id and then finally enroll the student via his id to the appropriate course
to enroll the student I should use this endpoint?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm sorry if this is a bit much to ask but would you be able to give me an example of what those requests would look like? Any language is welcome or just example cURL request...
I guess I'll show you what I'm doing as well, this returns a 500 error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A basic curl example would look like this:
curl -H "Authorization: Bearer <token>" -X POST "https://<domain>.instructure.com/api/v1/accounts/self/users" -F 'pseudonym[unique_id]=danny@instructure.com'
I don't remember offhand the data structure, but if I recall the strings represented in the documentation are actually strings and are not representations of JavaScript objects. Meaning you want your data to actually be something like:
'user[name]': "First Last"
not
{
'user': {
'name': "first last"
}
}
you can search for examples of -d or -f in the all resources page to get a sense.
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.