Skip to content

Users API

This file contains functions to manage user-related operations such as fetching users, creating users, deleting users and passwords.

Functions

GET getUsers()

Fetches all users.

Input: None
Output: List of users.

Request Details:

  • URL: authService/auth/all
  • Method: GET

GET getUser(user)

Fetches details of a specific user.

Input:

  • user (string): The user identifier.

Output: User details.

Request Details:

  • URL: authService/auth/{user}
  • Method: GET

GET getMe()

Fetches details of the currently logged-in user.

Input: None
Output: Current user details.

Request Details:

  • URL: authService/auth/me
  • Method: GET
  • With Credentials: true

POST createUser(user)

Creates a new user.

Input:

  • user (object): User data.

Output: Confirmation of user creation.

Request Details:

  • URL: authService/auth/
  • Method: POST

DELETE deleteUser(user)

Deletes a user.

Input:

  • user (string): The user identifier.

Output: Confirmation of user deletion.

Request Details:

  • URL: authService/auth/{user}
  • Method: DELETE

POST changeUserPassword(password)

Changes the password of the currently logged-in user.

Input:

  • password (object): Contains currentPassword and newPassword.

Output: Confirmation of password change.

Request Details:

  • URL: authService/auth/me/password
  • Method: POST