Get Role
curl --request GET \
--url https://api.example.com/roles/{id}import requests
url = "https://api.example.com/roles/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/roles/{id}', 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/{id}",
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/{id}"
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/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/roles/{id}")
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{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"production_id": "<string>"
}Roles
Get Role
Retrieve a specific role by ID
GET
/
roles
/
{id}
Get Role
curl --request GET \
--url https://api.example.com/roles/{id}import requests
url = "https://api.example.com/roles/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/roles/{id}', 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/{id}",
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/{id}"
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/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/roles/{id}")
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{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"production_id": "<string>"
}Overview
Returns detailed information about a single role/character identified by its unique ID.Path Parameters
The unique identifier of the role
Request
curl https://entertheatre.com/api/roles/role-001
const roleId = 'role-001';
const response = await fetch(`https://entertheatre.com/api/roles/${roleId}`);
const role = await response.json();
import requests
role_id = 'role-001'
response = requests.get(f'https://entertheatre.com/api/roles/{role_id}')
role = response.json()
Response
Unique identifier for the role
Name of the character/role
Description of the character
ID of the production this role belongs to
Example Response
{
"id": "role-001",
"name": "Grizabella",
"description": "The glamour cat who sings 'Memory'. Once a glamorous cat who left the Jellicle tribe to explore the world, she returns old, disheveled, and rejected by her former friends.",
"production_id": "prod-005"
}
Error Response
{
"error": "Role not found"
}
Status Codes
| Status | Description |
|---|---|
200 | Success - returns role object |
404 | Role not found |
500 | Server error |
⌘I