Account Endpoints¶
Login¶
1 |
|
This endpoint allows the user to sign in to his/her account by providing a valid username and password. The request body for the endpoint is a json object that takes a string for a username and a password:
1 2 3 4 |
|
Possible responses are a 200 Success code, 400 Bad Request or 401 Unauthorized.
Register¶
1 |
|
Registers a new user in the REST-API.
The json object expects a username, password, display name, department id, and role.
1 2 3 4 5 6 7 |
|
Possible responses are 200 Success, 400 Bad Request, 403 Forbidden, 409 Conflict or a 500 server error.
Update Password¶
1 |
|
Allows the user to update his password with a PUT request, if they know their old password.
An example URL for updating password with a user ID http://localhost:5000/v1/User/fbfd2be6-414a-4c34-897b-49c3fad64d21/Account/password
and the request body requires the old password and a new password:
1 2 3 4 |
|
The possible responses are 200 Success, 400 Bad Request, 403 Forbidden, 404 Not Found or 500 a server error.
Set a New Password¶
1 |
|
Allows a user to set a new password with a POST request, if they forgot theirs. The request then needs a new password as well as the given user password-reset-token:
1 2 3 4 |
|
Possible responses are 200 Success, 400 Bad Request, 401 Unauthorized and 404 Not Found.
Requesting a Password Reset Token¶
1 |
|
Allows the user to get a password reset token for a given user. This GET request outputs a password reset token for a given user, e.g. Request URL:
1 |
|
and response body:
1 2 3 |
|
The token string is the input in the POST request 'Set a new password'. Possible response codes are 200 success, 401 Unauthorized and 404 Not Found.
Delete User¶
1 |
|
Deletes the user with the given id. The DELETE request takes the user id as input and prompts a response body with either a 200 Success, 400 Bad Request, 403 Forbidden, 409 Conflict or 500 a server error.