Actions
Create
Create a new user for the user that has authenticated itself. The user will be automagically linked to your domain.
https://portal.robotsindeklas.nl/API/v1/user/create
Parameters:
- name - string: the name of the new user;
- 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.
Info
Get the document of a particular user.
https://portal.robotsindeklas.nl/API/v1/user/info
Parameter:
- 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.
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.
Share
Share a user with a user or group. We define four levels of share rights:
- 0 (revoked rights): user or group will no longer have access to this user
- 1 (play rights): user or group will see this user appear under the user tab.
- 2 (edit rights): user or group is allowed to manage this user.
- 3 (admin rights): user or group is allowed to manage and further share this user.
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.
Trash
Remove a user or bring it back from the trash bin.
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.
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
}