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/loginPOSTObtain a JWT token β body: { username, password }
Body (JSON)
{
"username": "admin",
"password": "your-password"
}Collection
/api/productsGETList 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/idGETReturn 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/randomPOSTCreate a product with random data β no body needed
Reset
/api/products/resetPOSTRestore the store with 2 random products β no body needed
Sitemap
/sitemap.xmlGETXML Sitemap with static pages and products
RSS Feed
/feed.xmlGETRSS Feed with all products sorted by date