C# Cinema API Challenge - Extension Criteria (0.2.2)

Download OpenAPI specification:Download

customers

Create a customer

Create a new customer account.

Request Body schema: application/json
name
required
string
email
required
email <email>
phone
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "Chris Wolstenholme",
  • "email": "chris@muse.mu",
  • "phone": "+44729388192"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get all customers

Get a list of every customer.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": [
    ]
}

Update a customer

Update an existing customer. If any field is not provided, the original value should not be changed. Any combination of fields can be updated.

path Parameters
id
required
integer

The ID of the customer to update

Request Body schema: application/json
name
string
email
email <email>
phone
string

Responses

Request samples

Content type
application/json
{
  • "name": "Chris Wolstenholme",
  • "email": "chris@muse.mu",
  • "phone": "+44729388192"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Delete a customer

Delete an existing customer. When deleting data, it's useful to send the deleted record back to the client so they can re-create it if deletion was a mistake.

path Parameters
id
required
integer

The ID of the customer to delete

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

movies

Create a movie

Create a new movie. Optionally, a screenings array can be provided to create screenings when the movie gets created. If no screenings array is provided, the movie should be created as normal.

Request Body schema: application/json
title
required
string
rating
required
string
description
required
string
runtimeMins
required
integer
Array of objects

Responses

Request samples

Content type
application/json
{
  • "title": "Dodgeball",
  • "rating": "PG-13",
  • "description": "The greatest movie ever made.",
  • "runtimeMins": 126,
  • "screenings": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get all movies

Get a list of every movie.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": [
    ]
}

Update a movie

Update an existing movie. If any field is not provided, the original value should not be changed. Any combination of fields can be updated.

path Parameters
id
required
integer

The ID of the movie to update

Request Body schema: application/json
title
string
rating
string
description
string
runtimeMins
integer

Responses

Request samples

Content type
application/json
{
  • "title": "Dodgeball",
  • "rating": "PG-13",
  • "description": "The greatest movie ever made.",
  • "runtimeMins": 126
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Delete a movie

Delete an existing movie. When deleting a movie, all of its screenings should also be deleted.

path Parameters
id
required
integer

The ID of the movie to delete

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

screenings

Create a screening

Create a screening for an existing movie.

path Parameters
id
required
integer

The ID of the movie to create a screening for

Request Body schema: application/json
screenNumber
required
integer
capacity
required
integer
startsAt
required
string <DateTime> YYYY-MM-DD HH:MM:SS

Responses

Request samples

Content type
application/json
{
  • "screenNumber": 5,
  • "capacity": 40,
  • "startsAt": "2023-03-19 11:30:00"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get all screenings

Get a list of every screening for a movie.

path Parameters
id
required
integer

The ID of the movie to retrieve the screenings for

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": [
    ]
}

tickets

Book a ticket

Create a new ticket for a particular customer and screening.

Request Body schema: application/json
numSeats
required
integer

Responses

Request samples

Content type
application/json
{
  • "numSeats": 3
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get all tickets

Get a list of every ticket a customer has booked for a screening.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": [
    ]
}