Estudo API

Test REST API with CRUD operations over /api/products.
Base URL:

Each API call modifies the in-memory store β€” create, edit or delete products here and see the result reflected in real time on the cards page.

πŸ”’ All endpoints require authentication. GET requests need an API key (X-API-Key header); write operations (POST, PUT, PATCH, DELETE) need a Bearer JWT obtained from /api/auth/login.

Authentication/api/auth/login
POSTObtain a JWT token β€” body: { username, password }
Body (JSON)
{
  "username": "admin",
  "password": "your-password"
}
Collection/api/products
GETList all products
POSTCreate a new product
Body (JSON)
{
  "name": "New product",
  "description": "Description",
  "price": 9.99,
  "quantity": 5,
  "active": true,
  "createdAt": "2026-05-12T10:00:00.000Z"
}
Single product/api/products/id
GETReturn a product by ID
PUTReplace the full product
Body (JSON)
{
  "name": "Updated product",
  "description": "New description",
  "price": 19.99,
  "quantity": 8,
  "active": true,
  "createdAt": "2026-05-12T10:00:00.000Z"
}
PATCHPartially update fields
Body (JSON)
{
  "active": false,
  "price": 5.5,
  "quantity": 2
}
DELETERemove a product by ID
Random product/api/products/random
POSTCreate a product with random data β€” no body needed
Reset/api/products/reset
POSTRestore the store with 2 random products β€” no body needed
Sitemap/sitemap.xml
GETXML Sitemap with static pages and products
RSS Feed/feed.xml
GETRSS Feed with all products sorted by date