Base URL
http://localhost:8080/api/tours
Get All Tours
Retrieve a list of all tours in the platform.
Response
Array of tour objects
Unique identifier for the tour
ID of the guide leading the tour
Tour title (max 180 characters)
Detailed tour description
Tour price (precision 10, scale 2)
Currency code (3 characters, e.g., USD, EUR)
Tour duration in hours (precision 4, scale 1)
Maximum number of participants allowed
Location where the tour starts (max 255 characters)
Tour status: draft, pending, active, or inactive
URL to the tour cover image (max 500 characters)
CSS class for image styling (max 80 characters)
Average rating (precision 3, scale 2)
Total number of bookings for this tour
Timestamp when the tour was created
Timestamp when the tour was last updated
List of associated tour destinations
Example
curl -X GET http://localhost:8080/api/tours
Get Tour by ID
Retrieve details of a specific tour by its ID.
Path Parameters
The unique identifier of the tour
Response
Returns a single tour object with the same structure as described in Get All Tours.
Example
curl -X GET http://localhost:8080/api/tours/1
Create Tour
Create a new tour in the system.
Request Body
ID of the guide leading the tour
Tour title (max 180 characters)
Detailed tour description
Currency code (3 characters)
Maximum number of participants
Location where the tour starts
Tour status: draft, pending, active, or inactive
URL to the tour cover image
CSS class for image styling
Response
Returns the created tour object including the generated tourId and timestamps.
Example
curl -X POST http://localhost:8080/api/tours \
-H "Content-Type: application/json" \
-d '{
"guideId": 10,
"categoryId": 2,
"title": "Historic City Walking Tour",
"description": "Explore the historic downtown area with an expert guide",
"price": 45.00,
"currency": "USD",
"durationHours": 3.0,
"maxGroupSize": 15,
"meetingPoint": "City Hall Plaza",
"status": "active",
"coverImage": "https://example.com/tours/city-tour.jpg",
"imageClass": "tour-cover-lg"
}'
Update Tour
Update an existing tour by its ID.
Path Parameters
The unique identifier of the tour to update
Request Body
Accepts the same fields as Create Tour. All fields are optional - only include fields you want to update.
Response
Returns the updated tour object.
Example
curl -X PUT http://localhost:8080/api/tours/1 \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Historic City Walking Tour",
"price": 50.00,
"status": "active"
}'
Delete Tour
DELETE /api/tours/{tourId}
Delete a tour by its ID.
Path Parameters
The unique identifier of the tour to delete
Response
Returns the deleted tour object.
Example
curl -X DELETE http://localhost:8080/api/tours/1
Add Tour Destination
POST /api/tours/{tourId}-add-destination
Associate a destination with a tour.
Path Parameters
The unique identifier of the tour
Response
Returns the updated tour object with the new destination association.
Example
curl -X POST http://localhost:8080/api/tours/1-add-destination