curl "https://api.dev.repp.co.il/v1/trainers/3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b"
const response = await fetch("https://api.dev.repp.co.il/v1/trainers/3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b");
if (!response.ok) throw new Error((await response.json()).error.message);
const data = await response.json();
/** A trainer in the public index. Never a phone number or the trainer's free-text about. */
interface Trainer {
id: string;
name: string;
photo_url: string | null;
styles: Style[];
regions: Region[];
rating: Rating;
verified: boolean;
available_now: boolean;
}
/** A training style: one of the keys in Catalog. */
type Style =
| "pilates"
| "barre"
| "strength"
| "crossfit"
| "trx"
| "calisthenics"
| "cardio"
| "hiit"
| "spinning"
| "running"
| "aqua"
| "yoga"
| "mobility"
| "meditation"
| "personal"
| "martial_arts"
| "boxing"
| "krav_maga"
| "dance"
| "zumba"
| "kids"
| "seniors"
| "other";
/** A region of Israel: one of the keys in Catalog. */
type Region = "gush_dan" | "shfela" | "sharon" | "haifa" | "jerusalem" | "north" | "south" | "judea_samaria";
/** The rating, or null while nobody has rated yet. */
type Rating = {
average: number;
count: number;
} | null;
interface ApiError {
error: { code: string; message: string; reason?: string };
}
const response = await fetch("https://api.dev.repp.co.il/v1/trainers/3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b");
if (!response.ok) throw new Error(((await response.json()) as ApiError).error.message);
const data = (await response.json()) as Trainer;
import requests
response = requests.get(
"https://api.dev.repp.co.il/v1/trainers/3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b",
timeout=30,
)
if not response.ok:
raise RuntimeError(response.json()["error"]["message"])
data = response.json()
<?php
$ch = curl_init("https://api.dev.repp.co.il/v1/trainers/3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
throw new RuntimeException($data["error"]["message"]);
}
200 · application/json {
"id": "3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b",
"name": "דנה כהן",
"photo_url": "https://example.supabase.co/storage/v1/object/public/avatars/3f2b9c1e/photo.webp",
"styles": [
"yoga",
"pilates"
],
"regions": [
"gush_dan"
],
"rating": {
"average": 4.8,
"count": 12
},
"verified": true,
"available_now": true
}