List Roles
curl --request GET \
--url https://api.example.com/rolesimport requests
url = "https://api.example.com/roles"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/roles', 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/roles",
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/roles"
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/roles")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/roles")
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{
"roles": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"production_id": "<string>"
}
]
}Roles
List Roles
Retrieve all character roles
GET
/
roles
List Roles
curl --request GET \
--url https://api.example.com/rolesimport requests
url = "https://api.example.com/roles"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/roles', 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/roles",
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/roles"
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/roles")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/roles")
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{
"roles": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"production_id": "<string>"
}
]
}Overview
Returns a list of all roles/characters defined in the database. Roles are linked to productions and can be assigned to cast members.Request
curl https://entertheatre.com/api/roles
const response = await fetch('https://entertheatre.com/api/roles');
const roles = await response.json();
import requests
response = requests.get('https://entertheatre.com/api/roles')
roles = response.json()
Response
Example Response
[
{
"id": "role-001",
"name": "Grizabella",
"description": "The glamour cat who sings 'Memory'",
"production_id": "prod-005"
},
{
"id": "role-002",
"name": "Jean Valjean",
"description": "The protagonist, a former convict seeking redemption",
"production_id": "prod-003"
},
{
"id": "role-003",
"name": "The Phantom",
"description": "The mysterious masked figure who haunts the Paris Opera House",
"production_id": "prod-001"
},
{
"id": "role-004",
"name": "Christine Daaé",
"description": "The young soprano and love interest of the Phantom",
"production_id": "prod-001"
}
]
Status Codes
| Status | Description |
|---|---|
200 | Success - returns array of roles |
500 | Server error |
⌘I