Users API

Create User

A user is composed by the following fields

 Field name  Description
 id  the user unique identifier
username the user name. It has to be unique
 roles Set of roles assigned to the user
attributes Set of attributes and its values for the user
accountAccess Accesibility to the player (values: enable / disable)
nonPersonalAccount If the user account is a non personal one (values: true / false)
deleted If the account has been deleted (values: true / false)
passwordExpired If the password for the account is expired (values: true / false)
passwordChangeDate Maximum date in which the user needs to set a new password
isActive If the account is currently active (values: true / false)

Example:

{
"id":416,
"username":"test.user",
"email":"test.user@knowledge-values.com",
"roles":[{"id":2,"role":"USER","description":"Allows access to Match Web Player for consultation of all configured KBAs"}],
"attributes":[{"attribute":{"id":14,"name":"Company","description":"Needed for WISKit","unique":false,"mandatory":false},"value":"aaa"},{"attribute":{"id":11,"name":"ID","description":"This is your company ID number","unique":true,"mandatory":false},"value":null}],
"accountAccess":"ENABLED",
"nonPersonalAccount":false,
"deleted":false,
"passwordExpired":false,
"passwordChangeDate":null,
"isActive":true
}

Creates a user. The created user will have the same name as the uploaded file

POST/rest/msm/users
 Query parameters None
 Header
  • auth-token:token from authentication
  • Content-Type: application/json
 Header/Parameter  tenant
 Body
  • User: all the parametres needed to create the user. (See user definition above)
Returns The user with the id created
Required role KBA_MANAGER
Managed errors 401: insufficient privileges

Example request

curl 'http://localhost:8080/mwp/rest/msm/users'
-H 'Content-Type: application/json' -H 'auth-token: 4dbd0d4f-9f44-41ab-ba68-3a51f7fd834a.local' -H 'tenant:default' -d '{"nonPersonalAccount":false,
"attributes":[{"attribute":{"id":14,"name":"Company","description":"Needed for WISKit","unique":false,"mandatory":false},"value":null},{"attribute":{"id":22,"name":"AT1","description":"AT1","unique":false,"mandatory":false},"value":null},{"attribute":{"id":28,"name":"Profession","description":"What is your job?","unique":false,"mandatory":false},"value":null},{"attribute":{"id":11,"name":"ID","description":"This is your company ID number","unique":true,"mandatory":false},"value":null},{"attribute":{"id":33,"name":"givenName","description":null,"unique":false,"mandatory":false},"value":null},{"attribute":{"id":26,"name":"Voornaam","description":"something","unique":false,"mandatory":false},"value":""},{"attribute":{"id":27,"name":"New attribute","description":"Testing creation of attributes","unique":false,"mandatory":false},"value":null},{"attribute":{"id":24,"name":"Naam","description":"Volledige naam adviseur","unique":false,"mandatory":true},"value":"Test"},{"attribute":{"id":25,"name":"Achternaam","description":"Something","unique":false,"mandatory":false},"value":"User"},{"attribute":{"id":13,"name":"Role","description":"Role for a user","unique":false,"mandatory":false},"value":"Adviseur"},{"attribute":{"id":15,"name":"Logo","description":"Needed for WISKit","unique":false,"mandatory":false},"value":null},{"attribute":{"id":32,"name":"testToBeRemoved","description":"testing process","unique":true,"mandatory":false},"value":null}],
"accountAccess":"ENABLED",
"roles":[{"id":2,"role":"USER","description":"Allows access to Match Web Player for consultation of all configured KBAs"}],
"username":"user.test",
"email":"noreply@knowledge-values.com",
"password":null}'

Example response

{
"id":420,
"username":"user.test",
"email":"noreply@knowledge-values.com",
"roles":[{"id":2,"role":"USER","description":"Allows access to Match Web Player for consultation of all configured KBAs"}],
"attributes":[{"attribute":{"id":14,"name":"Company","description":"Needed for WISKit","unique":false,"mandatory":false},"value":null},{"attribute":{"id":22,"name":"AT1","description":"AT1","unique":false,"mandatory":false},"value":null},{"attribute":{"id":28,"name":"Profession","description":"What is your job?","unique":false,"mandatory":false},"value":null},{"attribute":{"id":11,"name":"ID","description":"This is your company ID number","unique":true,"mandatory":false},"value":null},{"attribute":{"id":33,"name":"givenName","description":null,"unique":false,"mandatory":false},"value":null},{"attribute":{"id":26,"name":"Voornaam","description":"something","unique":false,"mandatory":false},"value":""},{"attribute":{"id":27,"name":"New attribute","description":"Testing creation of attributes","unique":false,"mandatory":false},"value":null},{"attribute":{"id":24,"name":"Naam","description":"Volledige naam adviseur","unique":false,"mandatory":true},"value":"Test"},{"attribute":{"id":25,"name":"Achternaam","description":"Something","unique":false,"mandatory":false},"value":"User"},{"attribute":{"id":13,"name":"Role","description":"Role for a user","unique":false,"mandatory":false},"value":"Adviseur"},{"attribute":{"id":15,"name":"Logo","description":"Needed for WISKit","unique":false,"mandatory":false},"value":null},{"attribute":{"id":32,"name":"testToBeRemoved","description":"testing process","unique":true,"mandatory":false},"value":null}],
"accountAccess":"ENABLED",
"nonPersonalAccount":false,
"deleted":false,
"passwordExpired":false,
"passwordChangeDate":null,
"isActive":false
}