SDK (@phosra/sdk)
import { PhosraClient } from "@phosra/sdk";
const phosra = new PhosraClient({
baseUrl: "https://phosra-api-sandbox-production.up.railway.app/api/v1",
accessToken: process.env.PHOSRA_API_KEY,
});
const result = await phosra.children.ageRatings("a11ce0fa-0000-4000-8000-0000000000a1");
console.log(result);curl -sS "https://phosra-api-sandbox-production.up.railway.app/api/v1/children/a11ce0fa-0000-4000-8000-0000000000a1/age-ratings" \
-H "Authorization: Bearer $PHOSRA_API_KEY"
import os, requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.get(
f"{BASE}/children/a11ce0fa-0000-4000-8000-0000000000a1/age-ratings",
headers={"Authorization": f"Bearer {os.environ['PHOSRA_API_KEY']}"},
)
print(res.status_code, res.json())
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := "https://phosra-api-sandbox-production.up.railway.app/api/v1"
req, _ := http.NewRequest("GET", base+"/children/a11ce0fa-0000-4000-8000-0000000000a1/age-ratings", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("PHOSRA_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(out))
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/age-ratings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/age-ratings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/age-ratings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"age": 11,
"ratings": {
"csm": {
"id": "00000000-0000-0000-0005-000000000004",
"system_id": "csm",
"code": "10+",
"name": "Age 10+",
"description": "Appropriate for ages 10 and up",
"min_age": 10,
"display_order": 4,
"restrictive_idx": 4
},
"esrb": {
"id": "00000000-0000-0000-0003-000000000002",
"system_id": "esrb",
"code": "E10+",
"name": "Everyone 10+",
"description": "Content generally suitable for ages 10 and up",
"min_age": 10,
"display_order": 2,
"restrictive_idx": 2
},
"mpaa": {
"id": "00000000-0000-0000-0001-000000000002",
"system_id": "mpaa",
"code": "PG",
"name": "Parental Guidance",
"description": "Some material may not be suitable for children",
"min_age": 0,
"display_order": 2,
"restrictive_idx": 2
},
"pegi": {
"id": "00000000-0000-0000-0004-000000000002",
"system_id": "pegi",
"code": "7",
"name": "PEGI 7",
"description": "Suitable for ages 7 and older",
"min_age": 7,
"display_order": 2,
"restrictive_idx": 2
},
"tvpg": {
"id": "00000000-0000-0000-0002-000000000004",
"system_id": "tvpg",
"code": "TV-PG",
"name": "Parental Guidance Suggested",
"description": "May contain some material parents find unsuitable",
"min_age": 0,
"display_order": 4,
"restrictive_idx": 2
}
}
}{
"error": "Bad Request",
"message": "child_name is required",
"code": 400
}{
"error": "Unauthorized",
"message": "missing or invalid Authorization header",
"code": 401
}{
"error": "Forbidden",
"message": "not a member of this family",
"code": 403
}{
"error": "Not Found",
"message": "policy not found",
"code": 404
}{
"error": "Too Many Requests",
"message": "rate limit exceeded",
"code": 429
}{
"error": "Internal Server Error",
"message": "internal error",
"code": 500
}Children
Get age-appropriate ratings
Get age-appropriate ratings for child
GET
/
children
/
{childID}
/
age-ratings
SDK (@phosra/sdk)
import { PhosraClient } from "@phosra/sdk";
const phosra = new PhosraClient({
baseUrl: "https://phosra-api-sandbox-production.up.railway.app/api/v1",
accessToken: process.env.PHOSRA_API_KEY,
});
const result = await phosra.children.ageRatings("a11ce0fa-0000-4000-8000-0000000000a1");
console.log(result);curl -sS "https://phosra-api-sandbox-production.up.railway.app/api/v1/children/a11ce0fa-0000-4000-8000-0000000000a1/age-ratings" \
-H "Authorization: Bearer $PHOSRA_API_KEY"
import os, requests
BASE = "https://phosra-api-sandbox-production.up.railway.app/api/v1"
res = requests.get(
f"{BASE}/children/a11ce0fa-0000-4000-8000-0000000000a1/age-ratings",
headers={"Authorization": f"Bearer {os.environ['PHOSRA_API_KEY']}"},
)
print(res.status_code, res.json())
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
base := "https://phosra-api-sandbox-production.up.railway.app/api/v1"
req, _ := http.NewRequest("GET", base+"/children/a11ce0fa-0000-4000-8000-0000000000a1/age-ratings", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("PHOSRA_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(out))
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/age-ratings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/age-ratings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://phosra-api-sandbox-production.up.railway.app/api/v1/children/{childID}/age-ratings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"age": 11,
"ratings": {
"csm": {
"id": "00000000-0000-0000-0005-000000000004",
"system_id": "csm",
"code": "10+",
"name": "Age 10+",
"description": "Appropriate for ages 10 and up",
"min_age": 10,
"display_order": 4,
"restrictive_idx": 4
},
"esrb": {
"id": "00000000-0000-0000-0003-000000000002",
"system_id": "esrb",
"code": "E10+",
"name": "Everyone 10+",
"description": "Content generally suitable for ages 10 and up",
"min_age": 10,
"display_order": 2,
"restrictive_idx": 2
},
"mpaa": {
"id": "00000000-0000-0000-0001-000000000002",
"system_id": "mpaa",
"code": "PG",
"name": "Parental Guidance",
"description": "Some material may not be suitable for children",
"min_age": 0,
"display_order": 2,
"restrictive_idx": 2
},
"pegi": {
"id": "00000000-0000-0000-0004-000000000002",
"system_id": "pegi",
"code": "7",
"name": "PEGI 7",
"description": "Suitable for ages 7 and older",
"min_age": 7,
"display_order": 2,
"restrictive_idx": 2
},
"tvpg": {
"id": "00000000-0000-0000-0002-000000000004",
"system_id": "tvpg",
"code": "TV-PG",
"name": "Parental Guidance Suggested",
"description": "May contain some material parents find unsuitable",
"min_age": 0,
"display_order": 4,
"restrictive_idx": 2
}
}
}{
"error": "Bad Request",
"message": "child_name is required",
"code": 400
}{
"error": "Unauthorized",
"message": "missing or invalid Authorization header",
"code": 401
}{
"error": "Forbidden",
"message": "not a member of this family",
"code": 403
}{
"error": "Not Found",
"message": "policy not found",
"code": 404
}{
"error": "Too Many Requests",
"message": "rate limit exceeded",
"code": 429
}{
"error": "Internal Server Error",
"message": "internal error",
"code": 500
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
⌘I