User API
Metadata
Get the user info with the user id:
GET /users/136
Successful response:
Status: 200 OK Content-Type: application/json Body: { "id": 136, "userName": "admin", "name": "naam", "firstName": "voornaam", "email": "mail@adhese.com", "language": "en" }
Reset password
Send a reset password mail with username or user email:
POST /api/users/password/resetContent-Type: application/json Body: { "userName":"admin", "resetUrl":"/path" }
Successful response:
Status: 200 OK
Email :
Beste User Admin,We hebben een aanvraag ontvangen om uw wachtwoord te wijzigen. Als u uw wachtwoord niet wenst te wijzigen of als u deze aanvraag niet zelf maakte, mag u deze email negeren en zal er niets wijzigen.
Om uw wachtwoord te wijzigen, volg de onderstaande link voor 05 mrt 2014 12:10 http://stage.adhese.org/path?token=fniq7W/LCFJkS0KbFAfQA9G6QdAfo+xyN7+tf1PIE5I=
Unsuccessful response:
Status: 503 SERVICE_UNAVAILABLE (example if the mail was not send) Status: 404 (the user was not found)
Reset password with token
Use the token from the email
POST /api/users/password/reset/token
Content-Type: application/json
Body:
{
"token": "riis5eXq0MKhk1CZOgYbgHslqKZ+YrOJnflmEbBo7ok=",
"newPassword": "hallo"
}
Successful response:
The user is now logged in
Status: 201 CREATED Content-Type: application/json Body: { "id": 136 }
Unsuccessful response:
Status: 401 UNAUTHORIZED (wrong token) Status: 400 NOT_ACCEPTABLE (something went wrong, maybe a non posible new password, or password should be at least 4 chars long)