X-Library API Docs (0.0.1)

Download OpenAPI specification:Download

Library API for book management

Authentication

Creates a new user

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "email": "string",
  • "token": "string"
}

Logs the user in

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "email": "string",
  • "token": "string"
}

Deletes current session

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "success": true
}

Books

Returns all books.

Authorizations:
bearerAuth
query Parameters
page
number

Pagination index

page_size
number

Number of resources in a single page

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "pagination": {
    }
}

Create a new book

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "book": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Create a new book from ISBN number

Authorizations:
bearerAuth
path Parameters
isbn
required
string

ISBN number of the book

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get a single book

Authorizations:
bearerAuth
path Parameters
id
required
string

ID of the book

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update a single book

Authorizations:
bearerAuth
path Parameters
id
required
string

ID of the book

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "book": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update a single book

Authorizations:
bearerAuth
path Parameters
id
required
string

ID of the book

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "book": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a book

Authorizations:
bearerAuth
path Parameters
id
required
string

ID of the book

Responses

Mark book as read

Authorizations:
bearerAuth
path Parameters
id
required
string

ID of the book

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Add a review for a book

Authorizations:
bearerAuth
path Parameters
id
required
string

ID of the book

Request Body schema: application/json
object (review)

Responses

Request samples

Content type
application/json
{
  • "review": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Remove a review for a book

Authorizations:
bearerAuth
path Parameters
book_id
required
string

ID of the book

review_id
required
string

ID of the review

Responses

Library

Mark book as read

Authorizations:
bearerAuth
path Parameters
id
required
string

ID of the book

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Add a review for a book

Authorizations:
bearerAuth
path Parameters
id
required
string

ID of the book

Request Body schema: application/json
object (review)

Responses

Request samples

Content type
application/json
{
  • "review": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Remove a review for a book

Authorizations:
bearerAuth
path Parameters
book_id
required
string

ID of the book

review_id
required
string

ID of the review

Responses

Lists all reviews of the currently signed in user

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Lists all reviews of the specified user

path Parameters
id
required
string

ID of the user

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Get the Profile of the given User

Authorizations:
bearerAuth
path Parameters
id
required
string

ID of the user

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "email": "string",
  • "books_read": {
    },
  • "reviews": {
    }
}

Get the Profile of the currently signed in user

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "email": "string",
  • "books_read": {
    },
  • "reviews": {
    }
}