3

I need to create users in Open edX and sign them in via an API call, and thus do all the API stuff. What the major idea here is to create a one log in system where my user can log into this software we have and thus browse all the courseware and attend classes and track his data through software. The interaction between course and the software will be done by the REST API.

Is copying his identity into the valid table/database of the openedx do the job, but it still won't solve the online problem.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Taranjeet Singh
  • 177
  • 1
  • 3
  • 13

2 Answers2

0

This is not possible at the moment in Open edX, as there is no API to create users. See the list of available APIs.

But it would not be too difficult to create an extra endpoint to create new users. To that end, I suggest you make use of the UserProfileFactory available in students.tests.factories: https://github.com/edx/edx-platform/blob/master/common/djangoapps/student/tests/factories.py#L39

It's a factory used for testing but that can also be used in production -- it's a dirty hack, but it works.

Régis B.
  • 10,092
  • 6
  • 54
  • 90
0

It possible to create/register user in Open edX using the REST API.

Send POST method to this url: youredxdomain.com/user_api/v1/account/registration/

Send the method to body using form-data.

In the url above you will get field in json like this

{
restrictions: {
min_length: 3,
max_length: 254
},
required: true,
name: "email",
errorMessages: { },
placeholder: "username@domain.com",
defaultValue: "",
instructions: "",
type: "email",
label: "Email"
},

When you send POST method to this url make sure to set key based on value of name in the json, for example the code key of the json above is email and set value to your email. Do the same on other field.

Hope it help.