|
|
## Actions
|
|
|
|
|
|
### Create
|
|
|
Create a new user for the user that has authenticated itself. The user will be automagically linked to your domain.
|
|
|
```
|
... | ... | @@ -5,9 +7,9 @@ https://portal.robotsindeklas.nl/API/v1/user/create |
|
|
```
|
|
|
|
|
|
Parameters:
|
|
|
- **username**, *string*: the name of the new user; // TODO change this to name
|
|
|
- **password**, *string*: the password of the new user, should consist out of at least 6 characters
|
|
|
- **type**, *string*: the type of the user. Note that as a child, you are not able to create a new user with admin rights. Currently available:
|
|
|
- **username** - *string*: the name of the new user; // TODO change this to name
|
|
|
- **password** - *string*: the password of the new user, should consist out of at least 6 characters
|
|
|
- **type** - *string*: the type of the user. Note that as a child, you are not able to create a new user with admin rights. Currently available:
|
|
|
- child: the most basic account;
|
|
|
- teacher: teachers can create only users with the type `child`;
|
|
|
- admin: admin users can create other admins, and has the most privileges within a domain.
|
... | ... | @@ -20,7 +22,7 @@ https://portal.robotsindeklas.nl/API/v1/user/info |
|
|
```
|
|
|
|
|
|
Parameter:
|
|
|
- **user**, *string*: the object id of the user you want the info of.
|
|
|
- **user** - *string*: the object id of the user you want the info of.
|
|
|
|
|
|
### Lock
|
|
|
Lock a user. If a user is locked, it will no longer be able to log in.
|
... | ... | @@ -30,8 +32,8 @@ https://portal.robotsindeklas.nl/API/v1/user/lock |
|
|
```
|
|
|
|
|
|
Parameters:
|
|
|
- **user**, *string*: the object id of the user you want to lock;
|
|
|
- **lock**, *boolean*, (optional, default: false): lock (true) or unlock (false) this user.
|
|
|
- **user** - *string*: the object id of the user you want to lock;
|
|
|
- **lock** - *boolean* - (optional, default: false): lock (true) or unlock (false) this user.
|
|
|
|
|
|
|
|
|
### Share
|
... | ... | @@ -47,9 +49,9 @@ https://portal.robotsindeklas.nl/API/v1/user/share |
|
|
```
|
|
|
|
|
|
Parameters:
|
|
|
- **user**, *string*: the object id of the user you want to share;
|
|
|
- **level**, *int*: the share level we want to assign to the user or group with this request;
|
|
|
- **oid**, *string*: the object id of the user or group we want the share this user with.
|
|
|
- **user** - *string*: the object id of the user you want to share;
|
|
|
- **level** - *int*: the share level we want to assign to the user or group with this request;
|
|
|
- **oid** - *string*: the object id of the user or group we want the share this user with.
|
|
|
|
|
|
|
|
|
### Trash
|
... | ... | @@ -59,5 +61,55 @@ https://portal.robotsindeklas.nl/API/v1/user/trash |
|
|
```
|
|
|
|
|
|
Parameters:
|
|
|
- **user**, *string*: the object id of the user we want to trash;
|
|
|
- **del**, *boolean*: delete (true) or restore (false) deleted item. |
|
|
\ No newline at end of file |
|
|
- **user** - *string*: the object id of the user we want to trash;
|
|
|
- **del** - *boolean*: delete (true) or restore (false) deleted item.
|
|
|
|
|
|
## Response
|
|
|
If the request was successful, you will receive the following response:
|
|
|
|
|
|
Model:
|
|
|
```
|
|
|
{
|
|
|
'_id': ObjectId - The id of the app
|
|
|
'data': {
|
|
|
'domain': String - The domain the user is linked with
|
|
|
'fname': String - The first name of the user
|
|
|
'lname': String - The last name of the user
|
|
|
'email': String - The email of the user (optional, currently not used)
|
|
|
},
|
|
|
'name': String - The name of the user which is used to log in.
|
|
|
'type': String - The type of the user (admin, teacher, child)
|
|
|
'info': String - Additional info about the user (currently not used)
|
|
|
'tags': Array - An array of tags describing this user (currently not used)
|
|
|
'owner': ObjectId - The user id of the user who owns this user
|
|
|
'locked': Boolean - Is this user locked. If so, it will not be able to log in.
|
|
|
'img': String - The img url used as icon in the portal
|
|
|
'access': Integer - The access level you have over this user
|
|
|
}
|
|
|
```
|
|
|
|
|
|
Example:
|
|
|
|
|
|
```
|
|
|
{
|
|
|
'_id': {
|
|
|
'$oid': '60b3a61f45a7d01d94a9a7c6'
|
|
|
},
|
|
|
'data': {
|
|
|
'domain': 'API School',
|
|
|
'fname': 'demo',
|
|
|
'lname': '',
|
|
|
'email': ''
|
|
|
},
|
|
|
'name': 'demo',
|
|
|
'type': 'child',
|
|
|
'info': '',
|
|
|
'tags': [],
|
|
|
'owner': {
|
|
|
'$oid': '6be8674715f9d40d84316285'
|
|
|
},
|
|
|
'locked': False,
|
|
|
'img': 'img/avatar/adult/0.png',
|
|
|
'access': 3
|
|
|
}
|
|
|
``` |
|
|
\ No newline at end of file |