Skip to main content
GET
/
api
/
authors
/
{id}
Get Author
curl --request GET \
  --url https://api.example.com/api/authors/{id}
{
  "success": true,
  "timestamp": "<string>",
  "data": {
    "id": 123,
    "name": "<string>"
  }
}

Endpoint

GET /api/authors/{id}

Authentication

Requires authentication with a valid Bearer token.

Path Parameters

id
long
required
Unique identifier of the author to retrieve

Response

success
boolean
required
Indicates if the request was successful
timestamp
string
required
ISO 8601 timestamp of the response
data
object
required
Author details
id
long
required
Unique identifier for the author
name
string
required
Full name of the author

Example Request

curl -X GET "http://localhost:8080/api/authors/1" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Example Response

{
  "success": true,
  "timestamp": "2026-03-03T10:00:00Z",
  "data": {
    "id": 1,
    "name": "George Orwell"
  }
}

Error Responses

401 Unauthorized

{
  "success": false,
  "timestamp": "2026-03-03T10:00:00Z",
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required"
  }
}

404 Not Found

{
  "success": false,
  "timestamp": "2026-03-03T10:00:00Z",
  "error": {
    "code": "NOT_FOUND",
    "message": "Author not found with id: 999"
  }
}

Build docs developers (and LLMs) love