Tour Mangemnt APIs
Tour Mangemnt APIs
This document details the RESTful API endpoints for managing tour operations, built
with Flask and MongoDB Atlas. The APIs support creating, reading, updating, and
deleting tour data, as well as querying tours by city. A statistical analysis of the API
endpoints is included to provide insights into their structure and usage.
Base URL
https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app
API Endpoints
1. Hello World
Endpoint: /
Method: GET
Response:
Example:
curl https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app/
https://stackedit.io/app# 1/50
4/28/25, 1:06 PM StackEdit
Endpoint: /gettours
Method: GET
Response:
Example:
curl https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app/gettours
Response:
3. Get Tour by ID
Endpoint: /gettour/<tour_id>
Method: GET
Parameters:
Response:
https://stackedit.io/app# 2/50
4/28/25, 1:06 PM StackEdit
Example:
curl https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app/gettour/T00
Response:
Endpoint: /addtour
Method: POST
{
"TourID": "T002",
"TourName": "Asian Escape",
"Duration": "5 days",
"StartDate": "2025-07-01",
"EndDate": "2025-07-05",
"Destinations": ["Tokyo", "Kyoto"]
}
Response:
Example:
https://stackedit.io/app# 3/50
4/28/25, 1:06 PM StackEdit
Response:
5. Update Tour by ID
Endpoint: /updatetour/<tourid>
Method: PUT
Parameters:
Response:
Example:
Response:
https://stackedit.io/app# 4/50
4/28/25, 1:06 PM StackEdit
Endpoint: /nearbytours/<city>
Method: GET
Parameters:
Response:
Example:
curl https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app/nearbytours
Response:
Endpoint: /deletetourbyname/<tour_name>
Method: DELETE
Parameters:
Response:
https://stackedit.io/app# 5/50
4/28/25, 1:06 PM StackEdit
Example:
Response:
Overview
The API consists of 7 endpoints supporting CRUD (Create, Read, Update, Delete)
operations and a specialized query by city. Below is a statistical breakdown of the
endpoints based on their HTTP methods, functionality, and hypothetical usage patterns.
HTTP Method
Count
Percentage
Endpoints
GET
57.14%
https://stackedit.io/app# 6/50
4/28/25, 1:06 PM StackEdit
POST
14.29%
/addtour
PUT
14.29%
/updatetour/<tourid>
DELETE
14.29%
/deletetourbyname/<tour_name>
Insight: The majority (57.14%) of endpoints are read-only (GET), indicating a focus on
data retrieval. Write operations (POST, PUT, DELETE) are equally distributed, each
representing 14.29%.
Endpoint Functionality
Functionality
Count
Percentage
Endpoints
Read
https://stackedit.io/app# 7/50
4/28/25, 1:06 PM StackEdit
57.14%
Create
14.29%
/addtour
Update
14.29%
/updatetour/<tourid>
Delete
14.29%
/deletetourbyname/<tour_name>
Insight: Read operations dominate, aligning with typical API usage where data retrieval
is more frequent than modification.
Each endpoint supports multiple status codes based on success or error conditions:
Status Code
Endpoints Involved
https://stackedit.io/app# 8/50
4/28/25, 1:06 PM StackEdit
Percentage of Endpoints
200
100%
404
57.14%
400
28.57%
500
100%
Insight: All endpoints can return 200 (success) and 500 (server error), reflecting robust
error handling. 404 is common in endpoints with specific queries, and 400 is limited to
endpoints with input validation.
Assuming a sample of 1,000 API requests over a week (hypothetical, as no real data is
provided):
Endpoint
Estimated Requests
Percentage
Notes
https://stackedit.io/app# 9/50
4/28/25, 1:06 PM StackEdit
100
10%
/gettours
300
30%
/gettour/<tour_id>
200
20%
/nearbytours/<city>
250
25%
/addtour
50
5%
/updatetour/<tourid>
50
5%
https://stackedit.io/app# 10/50
4/28/25, 1:06 PM StackEdit
/deletetourbyname/<tour_name>
50
5%
Parameter Usage
Endpoint
Parameters
Type
Required
/gettour/<tour_id>
tour_id
Path
Yes
/updatetour/<tourid>
tourid
Path
Yes
/nearbytours/<city>
city
Path
https://stackedit.io/app# 11/50
4/28/25, 1:06 PM StackEdit
Yes
/deletetourbyname/<tour_name>
tour_name
Path
Yes
/addtour
JSON body
Body
/updatetour/<tourid>
JSON body
Body
Insight: 4 endpoints use path parameters for specific queries, while 2 require JSON
bodies for data submission. All parameters are required, ensuring strict input validation.
1. Using curl :
Execute commands as shown in the examples above.
Ensure proper URL encoding for path parameters (e.g.,
European%20Adventure ).
2. Using Postman:
Import endpoints and set the base URL.
Configure HTTP methods and JSON bodies for POST/PUT requests.
Verify responses for expected status codes and data.
3. Using a Browser:
https://stackedit.io/app# 12/50
4/28/25, 1:06 PM StackEdit
Notes
Conclusion
The Tour Operation API provides a robust interface for managing tour data, with a
strong emphasis on read operations (57.14% of endpoints). The statistical analysis
highlights a balanced design with comprehensive error handling and a focus on user-
friendly data retrieval. Hypothetical usage suggests read-heavy traffic, typical for travel-
related APIs. To enhance the API, consider adding authentication, pagination for
/gettours , and additional query filters for /nearbytours/<city> .
This document outlines the RESTful API for managing user operations, built with Flask
and MongoDB Atlas. The API supports user registration, login, data retrieval, updates,
https://stackedit.io/app# 13/50
4/28/25, 1:06 PM StackEdit
and deletion with role-based access control. A statistical analysis provides insights into
the API’s structure and usage patterns.
Base URL
https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app
API Endpoints
Endpoint: /getusersbyall
Method: GET
Response:
Example:
curl https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app/getusersbya
Response:
[
{
"UserID": "123e4567-e89b-12d3-a456-426614174000",
"Email": "[email protected]",
"PasswordHashed": "hashed_password",
https://stackedit.io/app# 14/50
4/28/25, 1:06 PM StackEdit
Endpoint: /getusers
Method: GET
Description: Retrieves all users’ data, accessible only to admins and travel agents.
Headers:
Response:
Example:
Response:
[
{
"UserID": "123e4567-e89b-12d3-a456-426614174000",
"Email": "[email protected]",
"PasswordHashed": "hashed_password",
"FullName": "John Doe",
"AccountCreatedAt": "2025-04-28T10:00:00Z",
https://stackedit.io/app# 15/50
4/28/25, 1:06 PM StackEdit
"LastLoginDate": "2025-04-28T12:00:00Z",
"LogoutTime": null,
"UserRole": "customer",
"EmailVerified": false,
"AccountStatus": "active"
}
]
3. Get User by ID
Endpoint: /getuser/<user_id>
Method: GET
Parameters:
Headers:
Response:
Example:
Response:
https://stackedit.io/app# 16/50
4/28/25, 1:06 PM StackEdit
{
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"email": "[email protected]",
"full_name": "John Doe",
"account_created_at": "2025-04-28T10:00:00Z",
"last_login_date": "2025-04-28T12:00:00Z",
"logout_time": null,
"user_role": "customer",
"email_verified": false,
"account_status": "active"
}
4. Register User
Endpoint: /signup
Method: POST
{
"email": "[email protected]",
"password": "securepassword123",
"full_name": "John Doe"
}
Response:
Example:
https://stackedit.io/app# 17/50
4/28/25, 1:06 PM StackEdit
Response:
5. Login User
Endpoint: /login
Method: POST
{
"email": "[email protected]",
"password": "securepassword123"
}
Response:
Example:
Response:
{
"message": "Login successful",
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"full_name": "John Doe",
"user_role": "customer",
"account_status": "active"
https://stackedit.io/app# 18/50
4/28/25, 1:06 PM StackEdit
6. Update User
Endpoint: /updateuser/<user_id>
Method: PATCH
Parameters:
{
"full_name": "Jane Doe",
"email_verified": true
}
Response:
Example:
Response:
https://stackedit.io/app# 19/50
4/28/25, 1:06 PM StackEdit
Endpoint: /deleteuser/<full_name>
Method: DELETE
Parameters:
Headers:
Response:
Example:
Response:
Statistical Analysis
Endpoint Summary
The API includes 7 endpoints for user management with role-based access control.
https://stackedit.io/app# 20/50
4/28/25, 1:06 PM StackEdit
Method
Count
Percentage
Endpoints
GET
42.86%
POST
28.57%
/signup , /login
PATCH
14.29%
/updateuser/<user_id>
DELETE
14.29%
/deleteuser/<full_name>
Insight: GET endpoints are the most common (42.86%), reflecting frequent data
retrieval needs, followed by POST for user creation and authentication.
https://stackedit.io/app# 21/50
4/28/25, 1:06 PM StackEdit
Functionality Breakdown
Function
Count
Percentage
Endpoints
Read
42.86%
Create
14.29%
/signup
Update
14.29%
/updateuser/<user_id>
Delete
14.29%
/deleteuser/<full_name>
Authenticate
1
https://stackedit.io/app# 22/50
4/28/25, 1:06 PM StackEdit
14.29%
/login
Insight: Read operations dominate, with authentication and data modification evenly
distributed.
Status Code
Count
Endpoints
200 OK
201 Created
/signup
/signup , /login
403 Forbidden
https://stackedit.io/app# 23/50
4/28/25, 1:06 PM StackEdit
All endpoints
Insight: Robust error handling with role-based access (403) and resource-specific errors
(404).
Endpoint
Requests
Percentage
Notes
/getusersbyall
200
20%
/getusers
150
15%
/getuser/<user_id>
150
15%
/signup
https://stackedit.io/app# 24/50
4/28/25, 1:06 PM StackEdit
200
20%
/login
250
25%
/updateuser/<user_id>
25
2.5%
Rare updates
/deleteuser/<full_name>
25
2.5%
Insight: Authentication ( /login ) and registration ( /signup ) are the most frequent,
followed by read operations.
Testing Instructions
Using curl
https://stackedit.io/app# 25/50
4/28/25, 1:06 PM StackEdit
Using Postman
Using a Browser
Best Practices
Security:
Store MongoDB credentials securely in environment variables.
Use HTTPS to protect sensitive data (e.g., passwords).
Implement JWT or session-based authentication for /login .
Error Handling: All endpoints include MongoDB connection checks and role-based
validation.
Scalability: Add pagination for /getusersbyall and /getusers to handle large
datasets.
Enhancements:
Add email verification for /signup .
Implement password reset functionality.
Allow role updates for admins via /updateuser/<user_id> .
Conclusion
https://stackedit.io/app# 26/50
4/28/25, 1:06 PM StackEdit
The User Operation API provides a secure and efficient interface for managing user
accounts, with role-based access control for sensitive operations. The statistical analysis
shows a balanced design, with 42.86% read operations and frequent
authentication/registration usage (45% of hypothetical requests). For production,
prioritize security enhancements and scalability optimizations.
This document outlines the RESTful API for managing booking operations, built with
Flask and MongoDB Atlas. The API supports creating, reading, updating, and deleting
bookings, as well as initiating checkout sessions and updating payment statuses. A
statistical analysis provides insights into the API’s structure and usage patterns.
Base URL
https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app
API Endpoints
Endpoint: /getbookings
Method: GET
Response:
https://stackedit.io/app# 27/50
4/28/25, 1:06 PM StackEdit
Example:
curl https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app/getbookings
Response:
[
{
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"user_email": "[email protected]",
"tour_id": "T001",
"tour_destination": "Paris",
"tour_dates": "2025-06-01 to 2025-06-07",
"booking_status": "Pending",
"payment_status": "Unpaid",
"payment_amount": 1500.00,
"booking_reference": "BR123456"
}
]
Endpoint: /getbooking/<user_id>
Method: GET
Parameters:
Response:
https://stackedit.io/app# 28/50
4/28/25, 1:06 PM StackEdit
Example:
curl https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app/getbooking/
Response:
{
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"user_email": "[email protected]",
"tour_id": "T001",
"tour_destination": "Paris",
"tour_dates": "2025-06-01 to 2025-06-07",
"booking_status": "Pending",
"payment_status": "Unpaid",
"payment_amount": 1500.00,
"booking_reference": "BR123456"
}
3. Create Booking
Endpoint: /addbooking
Method: POST
{
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"user_email": "[email protected]",
"tour_id": "T001",
"tour_destination": "Paris",
"tour_dates": "2025-06-01 to 2025-06-07",
"booking_status": "Pending",
"payment_status": "Unpaid",
"payment_amount": 1500.00,
"booking_reference": "BR123456"
}
https://stackedit.io/app# 29/50
4/28/25, 1:06 PM StackEdit
Response:
Example:
Response:
{
"message": "Booking added successfully",
"booking_reference": "BR123456"
}
Endpoint: /deletebooking/<booking_reference>
Method: DELETE
Parameters:
Response:
Example:
https://stackedit.io/app# 30/50
4/28/25, 1:06 PM StackEdit
Response:
{
"message": "Booking with reference BR123456 deleted successfully"
}
Endpoint: /checkout-session
Method: POST
{
"booking_reference": "BR123456"
}
Response:
Example:
Response:
https://stackedit.io/app# 31/50
4/28/25, 1:06 PM StackEdit
{
"booking_reference": "BR123456",
"payment_amount": 1500.00,
"currency": "USD",
"payment_status": "Initiated",
"payment_url": "https://payment-gateway.example.com/pay/BR123456"
}
Endpoint: /updatepayment/<booking_reference>
Method: PUT
Parameters:
Response:
Example:
Response:
{
"message": "Payment status updated to Paid for booking BR123456"
}
https://stackedit.io/app# 32/50
4/28/25, 1:06 PM StackEdit
Statistical Analysis
Endpoint Summary
The API includes 6 endpoints for managing bookings and payment processes.
Method
Count
Percentage
Endpoints
GET
33.33%
/getbookings , /getbooking/<user_id>
POST
33.33%
/addbooking , /checkout-session
PUT
16.67%
/updatepayment/<booking_reference>
DELETE
https://stackedit.io/app# 33/50
4/28/25, 1:06 PM StackEdit
16.67%
/deletebooking/<booking_reference>
Insight: Balanced distribution between read (GET) and write (POST, PUT, DELETE)
operations, reflecting diverse booking management needs.
Functionality Breakdown
Function
Count
Percentage
Endpoints
Read
33.33%
/getbookings , /getbooking/<user_id>
Create
16.67%
/addbooking
Delete
16.67%
/deletebooking/<booking_reference>
Payment
https://stackedit.io/app# 34/50
4/28/25, 1:06 PM StackEdit
33.33%
/checkout-session , /updatepayment/<booking_reference>
Insight: Equal focus on reading bookings and payment-related operations, with single
endpoints for creation and deletion.
Status Code
Count
Endpoints
200 OK
201 Created
/addbooking
https://stackedit.io/app# 35/50
4/28/25, 1:06 PM StackEdit
All endpoints
Insight: Comprehensive error handling with specific validation (400) and resource errors
(404).
Endpoint
Requests
Percentage
Notes
/getbookings
250
25%
/getbooking/<user_id>
200
20%
/addbooking
200
20%
New bookings
/deletebooking/<booking_reference>
50
https://stackedit.io/app# 36/50
4/28/25, 1:06 PM StackEdit
5%
Booking cancellations
/checkout-session
200
20%
Payment initiations
/updatepayment/<booking_reference>
100
10%
Payment confirmations
Insight: Read and payment-related endpoints dominate (65%), with booking creation
also significant.
Testing Instructions
Using curl
Using Postman
https://stackedit.io/app# 37/50
4/28/25, 1:06 PM StackEdit
Using a Browser
Best Practices
Security:
Store MongoDB credentials in environment variables.
Implement authentication to restrict /addbooking ,
/deletebooking/<booking_reference> , and
/updatepayment/<booking_reference> to authorized users.
Use HTTPS to protect sensitive data (e.g., payment details).
Error Handling: All endpoints include MongoDB connection checks and
appropriate status codes.
Scalability: Add pagination for /getbookings to handle large datasets.
Enhancements:
Integrate a real payment gateway (e.g., Stripe) for /checkout-session .
Add validation for tour_id and user_id against the Tour and User
collections.
Implement booking status transitions (e.g., Pending to Cancelled ).
Use jsonify : Replace json.dumps with jsonify for consistent Flask JSON
responses (e.g., in read_bookings , read_booking_by_user_id , etc.).
Authentication: Add role-based access control for sensitive endpoints (e.g.,
/deletebooking/<booking_reference> ).
Validation: Ensure booking_reference is unique in /addbooking to prevent
duplicates.
https://stackedit.io/app# 38/50
4/28/25, 1:06 PM StackEdit
Conclusion
The Booking System API provides a robust interface for managing travel bookings and
payments, with a balanced focus on read (33.33%) and payment-related operations
(33.33%). The statistical analysis highlights frequent usage of read and payment
endpoints (65% of hypothetical requests). For production, prioritize security, payment
gateway integration, and scalability enhancements.
This document outlines the RESTful API for managing review operations, built with Flask
and MongoDB Atlas. The API supports creating, reading, updating, and deleting reviews
for travel tours. A statistical analysis provides insights into the API’s structure and usage
patterns.
Base URL
https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app
API Endpoints
Endpoint: /getreviews
Method: GET
https://stackedit.io/app# 39/50
4/28/25, 1:06 PM StackEdit
Response:
Example:
curl https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app/getreviews
Response:
[
{
"review_id": "R001",
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"user_email": "[email protected]",
"tour_id": "T001",
"tour_destination": "Paris",
"rating": 5,
"review_text": "Amazing experience!",
"review_date": "2025-04-28T10:00:00Z"
}
]
Endpoint: /getreviewsbyuser/<user_id>
Method: GET
Parameters:
Response:
Example:
curl https://idx-mywebapi-34600209-e5q6islzdq-df.a.run.app/getreviewsb
Response:
[
{
"review_id": "R001",
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"user_email": "[email protected]",
"tour_id": "T001",
"tour_destination": "Paris",
"rating": 5,
"review_text": "Amazing experience!",
"review_date": "2025-04-28T10:00:00Z"
}
]
3. Create Review
Endpoint: /addreview
Method: POST
{
"review_id": "R002",
"user_id": "123e4567-e89b-12d3-a456-426614174000",
"user_email": "[email protected]",
"tour_id": "T001",
"tour_destination": "Paris",
"rating": 4,
"review_text": "Great tour, highly recommend!",
"review_date": "2025-04-28T12:00:00Z"
}
https://stackedit.io/app# 41/50
4/28/25, 1:06 PM StackEdit
Response:
Example:
Response:
4. Update Review
Endpoint: /updatereview/<review_id>
Method: PATCH
Parameters:
{
"rating": 3,
"review_text": "Good tour, but could be improved."
}
Response:
Example:
Response:
5. Delete Review
Endpoint: /deletereview/<review_id>
Method: DELETE
Parameters:
Response:
Example:
Response:
https://stackedit.io/app# 43/50
4/28/25, 1:06 PM StackEdit
Statistical Analysis
Endpoint Summary
Method
Count
Percentage
Endpoints
GET
40.00%
/getreviews , /getreviewsbyuser/<user_id>
POST
20.00%
/addreview
PATCH
20.00%
https://stackedit.io/app# 44/50
4/28/25, 1:06 PM StackEdit
/updatereview/<review_id>
DELETE
20.00%
/deletereview/<review_id>
Insight: GET endpoints are the most common (40%), reflecting frequent review retrieval,
with balanced support for creation, update, and deletion.
Functionality Breakdown
Function
Count
Percentage
Endpoints
Read
40.00%
/getreviews , /getreviewsbyuser/<user_id>
Create
20.00%
/addreview
Update
20.00%
https://stackedit.io/app# 45/50
4/28/25, 1:06 PM StackEdit
/updatereview/<review_id>
Delete
20.00%
/deletereview/<review_id>
Insight: Read operations dominate, aligning with typical review system usage where
viewing reviews is more frequent than modification.
Status Code
Count
Endpoints
200 OK
201 Created
/addreview
/updatereview/<review_id>
/updatereview/<review_id> , /deletereview/<review_id>
https://stackedit.io/app# 46/50
4/28/25, 1:06 PM StackEdit
All endpoints
Insight: Robust error handling with specific validation (400) and resource errors (404) for
update and delete operations.
Endpoint
Requests
Percentage
Notes
/getreviews
400
40%
/getreviewsbyuser/<user_id>
300
30%
/addreview
150
15%
/updatereview/<review_id>
https://stackedit.io/app# 47/50
4/28/25, 1:06 PM StackEdit
50
5%
Review edits
/deletereview/<review_id>
50
5%
Review deletions
Insight: Read operations dominate (70%), reflecting typical review system usage, with
review creation being moderately frequent.
Testing Instructions
Using curl
Using Postman
Using a Browser
https://stackedit.io/app# 48/50
4/28/25, 1:06 PM StackEdit
Example: https://idx-mywebapi-34600209-e5q6islzdq-
df.a.run.app/getreviews
Note: POST, PATCH, and DELETE endpoints require tools like Postman or curl .
Best Practices
Security:
Store MongoDB credentials in environment variables.
Implement authentication to restrict /addreview ,
/updatereview/<review_id> , and /deletereview/<review_id> to
authenticated users.
Ensure only the review owner or admins can update/delete reviews.
Use HTTPS to protect sensitive data (e.g., user email).
Error Handling: All endpoints include MongoDB connection checks and
appropriate status codes.
Scalability: Add pagination for /getreviews to handle large datasets.
Enhancements:
Validate user_id and tour_id against the User and Tour collections in
/addreview .
Add input validation for rating (e.g., 1-5) in /addreview and
/updatereview/<review_id> .
Implement a review moderation system for /addreview .
Use jsonify : Replace json.dumps with jsonify for consistent Flask JSON
responses (e.g., in read_reviews , get_reviews_byuser , etc.).
Input Validation: Add checks for required fields and valid data types in
/addreview (e.g., rating between 1-5, unique review_id ).
Authentication: Implement role-based access control to ensure only
authenticated users can create, update, or delete reviews.
Error Handling: Standardize error responses (e.g., get_reviews_byuser returns a
string "Connection Problem" instead of JSON).
https://stackedit.io/app# 49/50
4/28/25, 1:06 PM StackEdit
Conclusion
The Reviews System API provides an efficient interface for managing tour reviews, with
a strong focus on read operations (40% of endpoints). The statistical analysis highlights
frequent review retrieval (70% of hypothetical requests) and moderate creation activity.
For production, prioritize security, input validation, and scalability enhancements to
ensure a robust review system.
https://stackedit.io/app# 50/50