Share
Explore

Restful-Booker API

Test the key functionalities of the Restful-Booker API using Postman. Provide a concise report summarizing your approach, identified issues, and suggestions for improvement.

Instructions:

Access the API
Familiarize yourself with the API documentation: .
Ensure you have Postman installed.
Test Scenarios Create a Postman collection and test the following scenarios:

Scenario 1: Authentication and Booking Update

Endpoints:
POST /auth (for authentication)
PUT /booking/{id} (for updating a booking)
Request for Authentication:
{
"username": "admin",
"password": "password123"
}

Update Request Example: Update a booking (e.g., change the first name or price).
Task:
Verify that the authentication returns a valid token.
Use the token to update an existing booking and confirm the changes.
Test with an invalid token or unauthorized access and verify the responses.

Scenario 2: Retrieve Booking List

Endpoint: GET /booking
Parameters: Test without parameters and with query parameters firstname and lastname.
Task:
Verify that the response contains valid data.
Test different combinations of query parameters, including invalid values.

Scenario 3: Create a New Booking

Endpoint: POST /booking
Request Body Example:
{
"firstname": "Jane",
"lastname": "Doe",
"totalprice": 200,
"depositpaid": false,
"bookingdates": {
"checkin": "2024-12-15",
"checkout": "2024-12-20"
},
"additionalneeds": "Dinner"
}

Task:
Create a new booking and verify the response contains correct data.
Test with missing or invalid attributes (e.g., missing firstname or invalid checkin format).

Bonus Task: Assertions in Postman

Task:
Add assertions to your tests, such as:
HTTP status codes (e.g., 200, 201, 400).
Presence of key attributes (e.g., firstname, lastname, totalprice).
Correct date format (YYYY-MM-DD for checkin).
Include a sample Postman script in your report.

Submission Instructions:

Postman Collection:
Export the collection in JSON format and attach it to your submission.
Report:
Provide a concise document containing:
A list of tested scenarios.
Identified issues or inconsistencies.
Suggestions for improving the API (optional).
Submission Method:
Package all materials (Postman collection, report) into a ZIP file and submit it via email to or upload it to a shared drive and share the link.

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.