Cinema Booking API - Extension Criteria (0.0.1)

Download OpenAPI specification:Download

movies

Retrieve a list of movies

Allow for the runtimeLt and runtimeGt parameters to filter the results; both of these should be able to be used together and by themselves.

query Parameters
runtimeLt
integer

Only retrieve movies with a runtime less than the provided value

runtimeGt
integer

Only retrieve movies with a runtime greater than the provided value

Responses

Response samples

Content type
application/json
{
  • "movies": [
    ]
}

Create a movie

Include the ability to create screenings for the movie if the request body has a screenings property. If that property doesn't exist in the request body, just create the movie.

Request Body schema: application/json
title
string
runtimeMins
integer
Array of objects (ScreeningPost)

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "runtimeMins": 0,
  • "screenings": [
    ]
}

Response samples

Content type
application/json
{
  • "movie": {
    }
}

Retrieve a movie by ID

Allow either an ID or a title to be provided.

Responses

Response samples

Content type
application/json
{
  • "movie": {
    }
}

Update a movie

Include the ability to update screenings for the movie if the request body has a screenings property. If that property doesn't exist in the request body, just update the movie.

Request Body schema: application/json
title
string
runtimeMins
integer
Array of objects (ScreeningPost)

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "runtimeMins": 0,
  • "screenings": [
    ]
}

Response samples

Content type
application/json
{
  • "movie": {
    }
}

customers

Update a customer

Include the ability to update the contact data for the customer if the request body has a contact property. If that property doesn't exist in the request body, just update the customer.

Request Body schema: application/json
name
string
object (ContactPost)

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "contact": {
    }
}

Response samples

Content type
application/json
{
  • "customer": {
    }
}

screens

Create a screen

Include the ability to create screenings for a movie if the request body has a screenings property. If that property doesn't exist in the request body, just create the screen.

Request Body schema: application/json
number
integer
Array of objects (ScreeningPost)

Responses

Request samples

Content type
application/json
{
  • "number": 0,
  • "screenings": [
    ]
}

Response samples

Content type
application/json
{
  • "screen": {
    }
}

tickets

Create a ticket

The response should include the data for the customer, contact details, movie, screening and screen

Request Body schema: application/json
screeningId
integer
customerId
integer

Responses

Request samples

Content type
application/json
{
  • "screeningId": 0,
  • "customerId": 0
}

Response samples

Content type
application/json
{
  • "ticket": {
    }
}