A sandbox API for learning REST Assured and API automation testing. All data is static and deterministic.
admin / secret123X-API-Key: testkey123/auth/login with username & password aboveReturns all 5 users.
[
{"id": 1, "name": "John Doe", "email": "john@example.com", "age": 30, "city": "New York"},
{"id": 2, "name": "Jane Smith", "email": "jane@example.com", "age": 25, "city": "London"},
{"id": 3, "name": "Bob Wilson", "email": "bob@example.com", "age": 35, "city": "Paris"},
{"id": 4, "name": "Alice Brown", "email": "alice@example.com", "age": 28, "city": "Berlin"},
{"id": 5, "name": "Charlie Davis", "email": "charlie@example.com", "age": 32, "city": "Tokyo"}
]
Returns a single user by ID (1-5). Returns 404 if not found.
{"id": 1, "name": "John Doe", "email": "john@example.com", "age": 30, "city": "New York"}
{"error": "User with id 99 not found. Valid user IDs: 1-5", "status": 404}
Creates a user (simulated). Requires name and email in JSON body. Returns 201 with id: 6.
{"name": "Test User", "email": "test@example.com", "age": 25, "city": "Mumbai"}
{"id": 6, "name": "Test User", "email": "test@example.com", "age": 25, "city": "Mumbai"}
Full replacement update. Requires name and email. Returns 400 if missing.
{"error": "Missing required field(s): email. Required fields: name, email", "status": 400}
Partial update. Merges provided fields with existing user data. Unchanged fields keep their original values.
Deletes a user (simulated). Returns 204 No Content with empty body.
Returns allowed HTTP methods in the Allow header.
GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Same headers as GET but no response body.
Returns 5 products with nested category and specs objects.
{
"id": 1,
"name": "Laptop Pro",
"price": 1299.99,
"category": {"id": 1, "name": "electronics"},
"specs": {"weight": "1.5kg", "color": "silver", "inStock": true}
}
Returns a single product by ID (1-5).
Filter products by category. Valid: electronics, books, furniture.
[
{"id": 1, "name": "Laptop Pro", ...},
{"id": 2, "name": "Wireless Mouse", ...},
{"id": 5, "name": "Mechanical Keyboard", ...}
]
Returns 5 books with nested author object, tags array, and rating.
{
"id": 1,
"title": "The Great Gatsby",
"author": {"name": "F. Scott Fitzgerald", "nationality": "American"},
"tags": ["fiction", "classic", "literature"],
"rating": 4.5
}
Returns a single book by ID (1-5).
Returns the specified HTTP status code (100-599) with a JSON body describing it.
{"status": 418, "message": "I'm a teapot"}
Echoes all request headers back as JSON. Header names are uppercased.
{"headers": {"HOST": "testkru.com", "X-CUSTOM": "hello", ...}}
Returns custom response headers.
X-App-Version: 1.0
X-Request-Id: req-testkru-001
Cache-Control: no-cache
Content negotiation. Returns JSON or XML based on Accept header.
{"format": "json", "message": "Response in JSON format"}
<response><format>xml</format><message>Response in XML format</message></response>
Requires HTTP Basic Auth. Credentials: admin / secret123.
{"message": "Basic auth successful", "user": "admin"}
Returns a JWT token. Use with /auth/protected.
{"username": "admin", "password": "secret123"}
{"token": "eyJ...", "user": "admin"}
Requires Bearer token from /auth/login.
Authorization: Bearer <token>
{"message": "Access granted", "user": "admin"}
{"error": "Missing Bearer token. Send Authorization: Bearer <token> header. Get a token from POST /api/auth/login"}
Requires X-API-Key: testkey123 header.
{"message": "Valid API key", "key": "testkey123"}
Returns users as XML. Content-Type: application/xml.
<users>
<user>
<id>1</id>
<name>John Doe</name>
<email>john@example.com</email>
<age>30</age>
<city>New York</city>
</user>
...
</users>
Returns products as XML with flat structure (no nested objects).
<products>
<product>
<id>1</id>
<name>Laptop Pro</name>
<price>1299.99</price>
<category>electronics</category>
...
</product>
...
</products>
Sets two cookies via Set-Cookie headers: session_id=abc123 and theme=dark.
{"message": "Cookies have been set", "cookies": {"session_id": "abc123", "theme": "dark"}}
Returns all cookies sent by the client in the request.
{"cookies": {"session_id": "abc123", "theme": "dark"}}
Searches across a combined dataset of 15 items (5 users + 5 products + 5 books).
query - Search text (matches name/title)
category - Filter: users, products, or books
sort - asc (default) or desc
page - Page number (default: 1)
limit - Items per page (default: 5, max: 50)
{
"data": [{"name": "...", "category": "users", ...}, ...],
"meta": {"page": 1, "per_page": 5, "total": 15, "last_page": 3}
}
Echoes the JSON request body back verbatim.
{"message": "Hello REST Assured", "framework": "REST Assured"}
{"message": "Hello REST Assured", "framework": "REST Assured"}
Validates that JSON body contains non-empty name and email fields.
{"valid": true, "data": {"name": "Alice", "email": "alice@test.com"}}
{"valid": false, "errors": [
"Field 'name' is required and must not be empty",
"Field 'email' is required and must not be empty"
]}
Accepts application/x-www-form-urlencoded data and echoes params back.
{
"received": {"name": "John", "city": "New York"},
"contentType": "application/x-www-form-urlencoded"
}
Accepts multipart file upload (max 2MB). Returns file metadata. File is not stored.
{"filename": "file.txt", "size": 1024, "mimeType": "text/plain"}
Downloads a small CSV text file with Content-Disposition: attachment.
Delays the response by the specified number of seconds (max 3).
{"delayed": 2, "message": "Response delayed by 2 seconds"}
Issues a redirect to /api/users. Valid codes: 301, 302, 303, 307.
HTTP/1.1 302 Found
Location: https://testkru.com/api/users
Creates an order by combining user and product data. Practice request chaining.
{"userId": 1, "productId": 2}
{
"orderId": "ORD-001",
"user": {"id": 1, "name": "John Doe", "email": "john@example.com"},
"product": {"id": 2, "name": "Wireless Mouse", "price": 29.99},
"total": 29.99,
"status": "confirmed"
}
Returns the JSON Schema document for the User object. Use for JSON Schema validation.
Returns the JSON Schema document for the Product object (includes nested category and specs).
All errors return a consistent JSON shape:
{"error": "User with id 99 not found. Valid user IDs: 1-5", "status": 404}