Skip to main content
GET
/
users
/
{id}
curl -X GET https://api.library.com/users/1 \
  -u username:password
{
  "200": {},
  "401": {},
  "404": {},
  "id": 123,
  "firstname": "<string>",
  "lastname": "<string>",
  "email": "<string>",
  "borrowedBooks": [
    {
      "id": 123,
      "user": {},
      "book": {},
      "loanDate": "<string>",
      "returnDate": "<string>",
      "returned": true
    }
  ],
  "googleId": "<string>",
  "displayPicture": "<string>"
}

Authentication

This endpoint requires HTTP Basic Authentication.

Path Parameters

id
long
required
The unique identifier of the user to retrieve

Response

id
long
Unique identifier for the user
firstname
string
The user’s first name
lastname
string
The user’s last name
email
string
The user’s email address
borrowedBooks
array
Set of rental records for books borrowed by this user
googleId
string
Google OAuth ID (only included if set)
displayPicture
string
URL to the user’s display picture (only included if set)

Status Codes

200
OK
User successfully retrieved
401
Unauthorized
Missing or invalid authentication credentials
404
Not Found
User with the specified ID does not exist
curl -X GET https://api.library.com/users/1 \
  -u username:password

Build docs developers (and LLMs) love