DSA, High & Low Level System Designs
1. User Management APIs
a. User Registration API
- Purpose: Allows users to create an account on BookMyShow.
- Request:
POST /api/users/register
- Parameters:
-
username: User’s name or email. -
password: User’s password. -
email/phone: Contact information. -
social_login: Option for Facebook/Google login.
-
- Response: Success or failure status, user profile details.
b. User Login API
- Purpose: Allows users to log in to their BookMyShow account.
- Request:
POST /api/users/login
- Parameters:
-
username/email: User’s email or username. -
password: User’s password.
-
- Response: Authentication token (JWT), user profile, session data.
c. Password Reset API
- Purpose: Allows users to reset their password if they forget it.
- Request:
POST /api/users/password-reset
- Parameters:
-
email: User’s email to send reset link.
-
- Response: Reset link sent or error message.
d. User Profile API
- Purpose: Fetches or updates user profile details.
- Request:
GET /api/users/{user_id}/profile(fetch)PUT /api/users/{user_id}/profile(update)
- Parameters:
-
For update: Name, email, phone number, etc.
-
- Response: Updated profile details or user data.
2. Movie and Event Discovery APIs
a. Search Movies API
- Purpose: Searches for movies or events based on filters like name, genre, location, and showtimes.
- Request:
GET /api/movies/search
- Parameters:
-
query: Movie name, genre, or event. -
location: City or region. -
showtime: Date/time filter.
-
- Response: List of matching movies or events with details (movie name, theater, timings).
b. Movie Details API
- Purpose: Provides detailed information about a particular movie.
- Request:
GET /api/movies/{movie_id}
- Parameters:
-
movie_id: Unique identifier of the movie.
-
- Response: Movie details, including synopsis, ratings, showtimes, trailers, cast, and crew.
c. Events API
- Purpose: Fetches upcoming events like concerts, plays, and other shows.
- Request:
GET /api/events
- Parameters:
-
type: Event type (concert, play, etc.). -
location: Event location.
-
- Response: List of events with date, time, and venue.
3. Seat Availability and Booking APIs
a. Get Available Seats API
- Purpose: Fetches available seats for a specific movie or event based on showtime.
- Request:
GET /api/seats/{show_id}/availability
- Parameters:
-
show_id: Unique show identifier.
-
- Response: Seat availability details (available, booked, or reserved).
b. Seat Reservation API
- Purpose: Allows a user to reserve a seat for a particular show.
- Request:
POST /api/seats/{show_id}/reserve
- Parameters:
-
user_id: User’s unique identifier. -
seats: List of reserved seat IDs.
-
- Response: Reservation confirmation, including seat numbers and payment status.
c. Ticket Booking API
- Purpose: Finalizes the ticket booking by confirming the reserved seats and processing payment.
- Request:
POST /api/bookings
- Parameters:
-
user_id: User’s ID. -
show_id: Movie/event show ID. -
seats: List of seats. -
payment_method: Payment method (credit card, UPI, etc.).
-
- Response: Booking confirmation, e-ticket with QR code.
4. Payment and Transaction APIs
a. Payment Initiation API
- Purpose: Starts the payment process for a ticket booking.
- Request:
POST /api/payment/initiate
- Parameters:
-
booking_id: Unique booking reference. -
amount: Total booking amount. -
payment_method: Chosen payment method.
-
- Response: Payment link or gateway redirect information.
b. Payment Confirmation API
- Purpose: Confirms the success or failure of a payment transaction.
- Request:
POST /api/payment/confirm
- Parameters:
-
transaction_id: Unique transaction identifier. -
status: Payment success or failure.
-
- Response: Payment status (confirmed or failed), payment ID.
c. Payment History API
- Purpose: Fetches a user’s payment history for past bookings.
- Request:
GET /api/users/{user_id}/payments
- Parameters:
-
user_id: User’s unique identifier.
-
- Response: List of payments with transaction IDs, amounts, dates, and statuses.
5. Event and Booking Management APIs (For Organizers)
a. Create Event API
- Purpose: Allows event organizers to create a new event (e.g., a movie premiere or a concert).
- Request:
POST /api/events
- Parameters:
-
event_name: Name of the event. -
event_type: Movie, concert, etc. -
location: Event location. -
timings: Event date and time. -
seats: Available seating configuration.
-
- Response: Event ID, creation confirmation.
b. Update Event API
- Purpose: Enables organizers to update event details (e.g., timings, venue).
- Request:
PUT /api/events/{event_id}
- Parameters:
-
event_id: Event’s unique identifier. -
updated_details: Updated information (showtimes, tickets, pricing).
-
- Response: Event update confirmation.
c. View Event Sales API
- Purpose: Fetches sales data for a particular event or show.
- Request:
GET /api/events/{event_id}/sales
- Parameters:
-
event_id: Event’s unique identifier.
-
- Response: Sales report including tickets sold, revenue generated, etc.
6. Notifications and Alerts APIs
a. Send Notification API
- Purpose: Sends alerts and reminders to users regarding bookings, offers, and upcoming events.
- Request:
POST /api/notifications/send
- Parameters:
-
user_id: Recipient’s user ID. -
message: Notification content (e.g., “Reminder: Your movie starts in 30 minutes”).
-
- Response: Notification sent status.
b. Push Notifications API
- Purpose: Allows sending push notifications to users for relevant updates.
- Request:
POST /api/push-notifications
- Parameters:
-
device_token: User’s device token for push notifications. -
message: The notification content.
-
- Response: Push notification status.
7. Reviews and Ratings APIs
a. Submit Review API
- Purpose: Allows users to submit a review and rating for a movie or event.
- Request:
POST /api/reviews
- Parameters:
-
user_id: User’s unique identifier. -
movie_idorevent_id: The item being reviewed. -
rating: Numeric rating (e.g., 1-5). -
comment: User’s review text.
-
- Response: Review submission confirmation.
b. Fetch Reviews API
- Purpose: Retrieves reviews and ratings for a specific movie or event.
- Request:
GET /api/reviews/{movie_id}
- Parameters:
-
movie_id: Movie or event ID.
-
- Response: List of reviews and average rating.