C# Cinema API Challenge - Core 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
{
  • "id": 1,
  • "name": "Chris Wolstenholme",
  • "email": "chris@muse.mu",
  • "phone": "+44729388192",
  • "createdAt": "2023-03-14T11:01:56.633+00:00",
  • "updatedAt": "2023-03-14T11:01:56.633+00:00"
}

Get all customers

Get a list of every customer.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update a customer

Update an existing customer. For ease of implementation, all fields are required from the client.

path Parameters
id
required
integer

The ID of the customer to update

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
{
  • "id": 1,
  • "name": "Chris Wolstenholme",
  • "email": "chris@muse.mu",
  • "phone": "+44729388192",
  • "createdAt": "2023-03-14T11:01:56.633+00:00",
  • "updatedAt": "2023-03-14T11:01:56.633+00:00"
}

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
{
  • "id": 1,
  • "name": "Chris Wolstenholme",
  • "email": "chris@muse.mu",
  • "phone": "+44729388192",
  • "createdAt": "2023-03-14T11:01:56.633+00:00",
  • "updatedAt": "2023-03-14T11:01:56.633+00:00"
}

movies

Create a movie

Create a new movie.

Request Body schema: application/json
title
required
string
rating
required
string
description
required
string
runtimeMins
required
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
{
  • "id": 1,
  • "title": "Dodgeball",
  • "rating": "PG-13",
  • "description": "The greatest movie ever made.",
  • "runtimeMins": 126,
  • "createdAt": "2023-03-14T11:01:56.633+00:00",
  • "updatedAt": "2023-03-14T11:01:56.633+00:00"
}

Get all movies

Get a list of every movie.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update a movie

Update an existing movie. For ease of implementation, all fields are required from the client.

path Parameters
id
required
integer

The ID of the movie to update

Request Body schema: application/json
title
required
string
rating
required
string
description
required
string
runtimeMins
required
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
{
  • "id": 1,
  • "title": "Dodgeball",
  • "rating": "PG-13",
  • "description": "The greatest movie ever made.",
  • "runtimeMins": 126,
  • "createdAt": "2023-03-14T11:01:56.633+00:00",
  • "updatedAt": "2023-03-14T11:01:56.633+00:00"
}

Delete a movie

Delete an existing movie. 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 movie to delete

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "Dodgeball",
  • "rating": "PG-13",
  • "description": "The greatest movie ever made.",
  • "runtimeMins": 126,
  • "createdAt": "2023-03-14T11:01:56.633+00:00",
  • "updatedAt": "2023-03-14T11:01:56.633+00:00"
}

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
{
  • "id": 1,
  • "screenNumber": 5,
  • "capacity": 40,
  • "startsAt": "2023-03-19T11:30:00.000+00:00",
  • "createdAt": "2023-03-14T11:01:56.633+00:00",
  • "updatedAt": "2023-03-14T11:01:56.633+00:00"
}

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
[
  • {
    }
]