Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .postman/resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Use this workspace to collaborate
workspace:
id: ""

# All resources in the `postman/` folder are automatically registered in Local View.
# Point to additional files outside the `postman/` folder to register them individually. Example:
#localResources:
# collections:
# - ../tests/E2E Test Collection/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Base URL: **http://localhost:3000**

No authentication required.

## Examples
## Examples Of X

**List books**
```bash
Expand Down
73 changes: 73 additions & 0 deletions postman/collections/Book API - Full Reference/.collection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
$kind: collection
description: >-
# 📚 Book API - Full Reference


This collection is a complete API reference for the **Book API**, a RESTful
service built with Express.js for managing a book catalog. It covers every
available endpoint, organized into logical folders for easy navigation.


## Base URL


`http://localhost:3000`


> The base URL is stored in the `{{baseUrl}}` collection variable and is
referenced across all requests.


## 📂 Folders


### General

Utility endpoints for checking API status and retrieving service information.


| Method | Endpoint | Description |

|--------|----------|-------------|

| `GET` | `/` | Returns API info and documentation link |

| `GET` | `/health` | Returns the health status of the API with a timestamp |


### Books

Full CRUD operations for managing books in the catalog.


| Method | Endpoint | Description |

|--------|----------|-------------|

| `GET` | `/api/v1/books` | List all books |

| `GET` | `/api/v1/books/:id` | Get a single book by ID |

| `POST` | `/api/v1/books` | Create a new book |

| `PUT` | `/api/v1/books/:id` | Update an existing book |

| `DELETE` | `/api/v1/books/:id` | Delete a book by ID |


## 🚀 Getting Started


1. **Set the base URL** — The `{{baseUrl}}` variable defaults to
`http://localhost:3000`. Update it in the collection variables if your server
runs on a different host or port.

2. **Start with General** — Use the **Root** and **Health Check** requests to
verify the API is running.

3. **Manage Books** — Use the **Books** folder to create, read, update, and
delete book records. A book requires a `title` and `author`; `year` and
`publisher` are optional.
variables:
- key: baseUrl
value: 'http://localhost:3000'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$kind: collection
name: Book API - Full Reference
variables:
baseUrl: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$kind: collection
name: Books
description: CRUD operations for managing books
order: 2000
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
$kind: http-request
name: Create Book
description: 'Creates a new book. Requires `title` (string, required) and `author` (string, required). Optional fields: `year` (non-negative integer) and `publisher` (string).'
method: POST
url: '{{baseUrl}}/api/v1/books'
order: 3000
headers:
- key: Content-Type
value: application/json
body:
type: json
content: |-
{
"title": "Dune",
"author": "Frank Herbert",
"year": 1965,
"publisher": "Chilton Books"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$kind: http-request
name: Delete Book
description: 'Deletes a book by ID. Returns 404 if the book is not found.'
method: DELETE
url: '{{baseUrl}}/api/v1/books/:id'
order: 5000
pathVariables:
- key: id
value: '1'
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$kind: http-request
name: Get Book
description: 'Retrieves a single book by its ID. Returns 404 if the book is not found.'
method: GET
url: '{{baseUrl}}/api/v1/books/:id'
order: 2000
pathVariables:
- key: id
value: '1'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$kind: http-request
name: List Books
description: Retrieves all books in the database. Returns an array of book objects.
method: GET
url: '{{baseUrl}}/api/v1/books'
order: 1000
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$kind: http-request
name: Update Book
description: 'Updates an existing book by ID. All fields are optional in the update payload. Returns 404 if the book is not found, 400 if validation fails.'
method: PUT
url: '{{baseUrl}}/api/v1/books/:id'
order: 4000
pathVariables:
- key: id
value: '1'
headers:
- key: Content-Type
value: application/json
body:
type: json
content: |-
{
"title": "The Great Gatsby (Revised)",
"year": 1925
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$kind: collection
name: General
description: General utility and info endpoints
order: 1000
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$kind: http-request
name: Health Check
description: Returns the health status of the API with a timestamp.
method: GET
url: '{{baseUrl}}/health'
order: 2000
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$kind: http-request
name: Root
description: Returns API info and documentation link.
method: GET
url: '{{baseUrl}}/'
order: 1000
9 changes: 9 additions & 0 deletions postman/collections/Book API/.resources/definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$kind: collection
name: Book API
description: A REST API for managing books. This collection provides endpoints for creating, reading, updating, and deleting books in the system.
variables:
- key: baseUrl
value: 'http://localhost:3000'
- key: bookId
value: ''
description: Book ID to be filled during testing
3 changes: 3 additions & 0 deletions postman/collections/Book API/Books/.resources/definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$kind: collection
name: Books
description: Endpoints for managing books - create, read, update, and delete operations
18 changes: 18 additions & 0 deletions postman/collections/Book API/Books/Create Book.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
$kind: http-request
name: Create Book
description: Create a new book
method: POST
url: '{{baseUrl}}/api/v1/books'
order: 3000
headers:
- key: Content-Type
value: application/json
body:
type: json
content: |-
{
"title": "The Great Gatsby",
"author": "F. Scott Fitzgerald",
"year": 1925,
"publisher": "Charles Scribner's Sons"
}
10 changes: 10 additions & 0 deletions postman/collections/Book API/Books/Delete Book.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$kind: http-request
name: Delete Book
description: Delete a book by ID
method: DELETE
url: '{{baseUrl}}/api/v1/books/{{bookId}}'
order: 5000
pathVariables:
- key: bookId
value: '{{bookId}}'
description: The unique identifier of the book to delete
10 changes: 10 additions & 0 deletions postman/collections/Book API/Books/Get Book.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$kind: http-request
name: Get Book
description: Get a specific book by ID
method: GET
url: '{{baseUrl}}/api/v1/books/{{bookId}}'
order: 2000
pathVariables:
- key: bookId
value: '{{bookId}}'
description: The unique identifier of the book
6 changes: 6 additions & 0 deletions postman/collections/Book API/Books/List Books.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$kind: http-request
name: List Books
description: Get all books
method: GET
url: '{{baseUrl}}/api/v1/books'
order: 1000
22 changes: 22 additions & 0 deletions postman/collections/Book API/Books/Update Book.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
$kind: http-request
name: Update Book
description: Update an existing book
method: PUT
url: '{{baseUrl}}/api/v1/books/{{bookId}}'
order: 4000
headers:
- key: Content-Type
value: application/json
pathVariables:
- key: bookId
value: '{{bookId}}'
description: The unique identifier of the book to update
body:
type: json
content: |-
{
"title": "Updated Title",
"author": "Updated Author",
"year": 2024,
"publisher": "Updated Publisher"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$kind: collection
name: General
description: General endpoints for API information and health checks
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$kind: http-request
name: Health Check
description: Health check endpoint returning status and timestamp
method: GET
url: '{{baseUrl}}/health'
order: 2000
6 changes: 6 additions & 0 deletions postman/collections/Book API/General/Root.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$kind: http-request
name: Root
description: Returns API info and documentation link
method: GET
url: '{{baseUrl}}/'
order: 1000
2 changes: 2 additions & 0 deletions postman/collections/New Collection/.resources/definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$kind: collection
name: New Collection
7 changes: 7 additions & 0 deletions postman/collections/New Collection/New Request.request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$kind: mcp-request
transport: stdio
command: ""
message: ""
settings:
requestTimeout: 0
order: 1775040399311
2 changes: 2 additions & 0 deletions postman/globals/workspace.globals.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: Globals
values: []