Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: update user operation: email is no longer mandatory and new argument introduced: 'passwordValidation'

...

Mandatory fields:

  • firstName
  • lastName
  • email
  • password
  • facility
  • role
  • status

...

  • A Facility with 'facility' id must exist
  • A Role with 'role' id must exist
  • A UserStatus with 'status' value must exist
  • 'password' must be longer than 5 characters and shorter than 20
  • If 'tagId' is not null, it must be longer than 5 characters and shorter than 20
  • If 'emai' is not null, 'email' must be a well formed email
  • If 'emai' is not null, 'email' must be unique among existing users.

The result in case of validation errors has the same structure as the validation errors returned by the patient creation operation.

Important notice: If a user is trying to modify his/her email, password and/or tagId, the argument 'passwordValidation' of this operation is mandatory and it must be the original (old) password of the current user.  

UserId and Username fields can't be modified by this operation. 

...

NameTypeMandatoryDescription
{requestedUserId}StringYesThe id of the requested user.
tokenStringYesSecurity Token obtained before.
userIdStringYesThe id of the logged in user.
firstNameStringYesThe new name for the user.
lastNameStringYesThe new last name for the user.
emailStringYesNoThe new email address for the user. If this parameter is not provided, the email of the user will not be modified.
passwordStringNo

The new password for the user.
At the moment, this is plain text. If this value is not provided, the original password of the user will not be modified.

organizationStringYesThe new id of the organization for the user.
facilityStringYesThe new id of the facility for the user.
roleStringYesThe new id of the role for the user.
tagIdStringNoThe new NFC tag id for the new user. If this value is not provided, the original tagId of the user will not be modified.

...

passwordValidationStringIf a user is trying to modify his/her email, password and/or tagId, the argument 'passwordValidation' -> YesThe original (old) password of the user. This argument is used for when a user tries to modify his/her OWN email, password and/or tag id.

curl 'http://192.168.2.103:8080/PresentationServices/users/354a7aae-ac06-4892-ac61-ce302351eb35' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Origin: file://' -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.2; Nexus 5 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'firstName=e&lastName=e&email=e%40e.com&password=&organization=UNC&facility=UNC&role=2&status=SUSPENDED&userId=sigal&token=8a4804ef-3301-4f89-a5a9-c3fed479d8c3' --compressed

...

NameTypeMandatoryDescription
{requestedUserId}StringYesThe id of the requested user.
tokenStringYesSecurity Token obtained before.
userIdStringYesThe id of the logged in user.

API Sample

curl -X DELETE 'http://192.168.2.103:8080/PresentationServices/users/354a7aae-ac06-4892-ac61-ce302351eb35' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Origin: file://' -H 'User-Agent: Mozilla/5.0 (Linux; Android 4.4.2; Nexus 5 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --compressed

...