Skip to content

Feature: Implement Get User Details API (GET /api/users/:userId) #61

@MessiasLima

Description

@MessiasLima

Feature: Implement Get User Details API (GET /api/users/:userId)

Background

This feature involves implementing the GET /api/users/:userId endpoint from the Umami API within the umami-kotlin library. This endpoint allows an authenticated user to retrieve detailed information about a specific user by their ID. This is essential for displaying user profiles, managing user-specific settings, or integrating with other user-centric features.

Implementing this functionality is crucial for providing comprehensive user management capabilities within the umami-kotlin client. It will enable applications to fetch and display individual user data, contributing to a more complete and interactive user experience. This work directly contributes to fulfilling the "Umami API" section of the project roadmap.

Acceptance criteria

  • GIVEN the Umami client is configured with a valid baseUrl and an authenticated user,
    WHEN a request is made to get details for a valid userId via a new API method (e.g., umami.users.getUser(userId)),
    THEN the client successfully sends a GET request to /api/users/:userId
    AND the method returns a successful response containing the user's details.
  • GIVEN the Umami client is configured with a valid baseUrl and an authenticated user,
    WHEN a request is made to get details for an invalid or non-existent userId via the new API method,
    THEN the client successfully sends a GET request to /api/users/:userId
    AND the method returns an error response (or throws an appropriate UmamiNotFoundException) indicating the user was not found.
  • GIVEN the Umami client is configured with a valid baseUrl,
    WHEN a request is made to get user details by an unauthenticated user via the new API method,
    THEN the client successfully sends a GET request to /api/users/:userId
    AND the method returns an error response (or throws an appropriate UmamiAuthException) indicating insufficient privileges.
  • GIVEN the Umami client is configured,
    WHEN a request is made to get user details and a network or server error occurs during the API call,
    THEN the new API method throws an appropriate exception (e.g., IOException, UmamiApiException).
  • GIVEN the umami-kotlin library is used in a project,
    WHEN a developer initializes the Umami client using Umami.create(),
    THEN the Umami instance exposes a public method (e.g., umami.users.getUser(userId: String): User) to interact with the GET /api/users/:userId endpoint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    To Do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions