Skip to main content
GET
/
authors
/
{id}
Get Author
curl --request GET \
  --url https://api.example.com/authors/{id}
{
  "200": {},
  "401": {},
  "404": {},
  "id": 123,
  "name": "<string>",
  "age": 123
}
Retrieves a specific author by their ID.

Authentication

This endpoint requires HTTP Basic Authentication.

Path Parameters

id
long
required
The unique identifier of the author to retrieve

Response

id
long
The unique identifier of the author
name
string
The name of the author
age
integer
The age of the author

Status Codes

200
OK
Author successfully retrieved
404
Not Found
Author with the specified ID does not exist
401
Unauthorized
Authentication credentials are missing or invalid

Example Request

curl -X GET http://localhost:8080/authors/1 \
  -u username:password

Example Response

{
  "id": 1,
  "name": "J.K. Rowling",
  "age": 58
}

Error Response

When the author is not found:
{
  "status": 404,
  "error": "Not Found"
}

Build docs developers (and LLMs) love