Waiting List API Documentation

Table of contents

This document describes the REST API endpoints provided by the Genum backend. All endpoints start with /api/user. Here is the base URL for all endpoints: https://backend-9qqc.onrender.com.

Response: All endpoints return a standardized ResponseDetails object that includes a timestamp, message, status code (as a String), and data (if successful). A typical ResponseDetails object looks like this:

{
    "timestamp": string,
    "message": string,
    "status": string,
    "data" : object // optional
}

Error handling: Specific HTTP status codes indicate errors as follows:

400 Bad Request: This means the input data is invalid. You can find more details in the response body.

409 Conflict: This means there is a resource conflict, such as trying to create a user that already exists.

Endpoints

  1. Get Waiting List

    Endpoint: /api/user/waiting-list

    Method: GET

    Description: Returns a paginated list of waiting list emails.

    Request Parameters: Optionally include size, page, and direction. If size is not specified, it defaults to 20. If page is not specified, it defaults to 0, which is the first page. If direction is not specified (asc/desc), it defaults to asc.

    Response: A typical response for getting the waiting list looks like this:

     {
       "content": [
         {
           "id": 1,
           "name": "Item 1",
           "description": "Description for Item 1"
         },
         {
           "id": 2,
           "name": "Item 2",
           "description": "Description for Item 2"
         }
       ],
       "pageable": {
         "sort": {
           "sorted": true,
           "unsorted": false,
           "empty": false
         },
         "offset": 0,
         "pageNumber": 0,
         "pageSize": 10,
         "paged": true,
         "unpaged": false
       },
       "totalPages": 5,
       "totalElements": 50,
       "last": false,
       "size": 10,
       "number": 0,
       "sort": {
         "sorted": true,
         "unsorted": false,
         "empty": false
       },
       "numberOfElements": 10,
       "first": true,
       "empty": false
     }
    
  2. Add to Waiting List

    Endpoint: /api/user/waiting-list

    Method: POST

    Errors: Returns a 409 Conflict if the email already exists or a 400 if the email is invalid.

    Description: Adds an email to the waiting list.

    Request Parameter: email - the email address to add to the waiting list.

    Response: Returns a 201 Created with a ResponseDetail object.