List Productions
curl --request GET \
--url https://api.example.com/productionsimport requests
url = "https://api.example.com/productions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/productions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/productions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/productions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/productions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/productions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"productions": [
{
"id": "<string>",
"show_id": "<string>",
"theatre_id": "<string>",
"opening_date": "<string>",
"closing_date": "<string>",
"show": {}
}
]
}Productions
List Productions
Retrieve all productions
GET
/
productions
List Productions
curl --request GET \
--url https://api.example.com/productionsimport requests
url = "https://api.example.com/productions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/productions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/productions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/productions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/productions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/productions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"productions": [
{
"id": "<string>",
"show_id": "<string>",
"theatre_id": "<string>",
"opening_date": "<string>",
"closing_date": "<string>",
"show": {}
}
]
}Overview
Returns a list of all productions (show runs at specific theatres) in the database. Optionally filter by theatre ID.Query Parameters
Filter productions by theatre ID
Request
# Get all productions
curl https://entertheatre.com/api/productions
# Filter by theatre
curl https://entertheatre.com/api/productions?theatre_id=theatre-001
// Get all productions
const response = await fetch('https://entertheatre.com/api/productions');
const productions = await response.json();
// Filter by theatre
const filtered = await fetch('https://entertheatre.com/api/productions?theatre_id=theatre-001');
const theatreProductions = await filtered.json();
import requests
# Get all productions
response = requests.get('https://entertheatre.com/api/productions')
productions = response.json()
# Filter by theatre
response = requests.get('https://entertheatre.com/api/productions', params={'theatre_id': 'theatre-001'})
theatre_productions = response.json()
Response
Array of production objects
Show Production Object
Show Production Object
Unique identifier for the production
ID of the associated show
ID of the theatre where the production runs
Opening date of the production (ISO 8601 format)
Closing date of the production (ISO 8601 format), null if open-ended
Nested show object with full show details
Example Response
[
{
"id": "prod-001",
"show_id": "550e8400-e29b-41d4-a716-446655440000",
"theatre_id": "theatre-001",
"opening_date": "1986-10-09",
"closing_date": null,
"show": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "The Phantom of the Opera",
"type": "musical",
"description": "Andrew Lloyd Webber's legendary musical...",
"image": "https://rluylvquemmzgljdklby.supabase.co/storage/v1/object/public/shows/phantom.jpg"
}
},
{
"id": "prod-002",
"show_id": "550e8400-e29b-41d4-a716-446655440001",
"theatre_id": "theatre-002",
"opening_date": "2017-12-21",
"closing_date": null,
"show": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"name": "Hamilton",
"type": "musical",
"description": "The story of America's founding father...",
"image": "https://rluylvquemmzgljdklby.supabase.co/storage/v1/object/public/shows/hamilton.jpg"
}
}
]
Status Codes
| Status | Description |
|---|---|
200 | Success - returns array of productions |
500 | Server error |
⌘I