Complete reference for all API endpoints with interactive testing capabilities
The Style Score API provides programmatic access to competition data, results, and administrative functions. All endpoints return JSON responses with UTF-8 encoding for proper international character support.
This documentation is organized by role so you can quickly find the APIs relevant to your job.
Security notes: Many endpoints (Judge, Head Judge, Heat Management, User/Token management) require an authenticated session and appropriate role (judge, head_judge, admin). Public endpoints are read-only and safe for embedding. Always test POST calls against a non-production event when possible.
Generates scoring summary tables with flexible filtering options and multiple output formats.
| Parameter | Type | Required | Description |
|---|---|---|---|
event_id |
integer | Yes | Event identifier |
category |
string | No | Category filter (default: "all") |
heat_run_filter |
JSON | No | Heat and run filtering: {"heat_id":[run1,run2]} |
format |
string | No | Output format: json, html, csv, pdf |
config_id |
integer | No | Saved configuration ID |
action |
string | No | Special actions: 'promote', 'get_participants_to_promote' |
Generates official start lists for events and heats with multiple output formats.
| Parameter | Type | Required | Description |
|---|---|---|---|
event_id |
integer | Yes | Event identifier |
heat_number |
integer | No | Specific heat number (omit for all heats) |
format |
string | No | Output format: json, html, csv, pdf |
page |
integer | No | Page number for pagination |
limit |
integer | No | Items per page (default: 50) |
Returns distinct participant categories for a given event.
| Parameter | Type | Required | Description |
|---|---|---|---|
event_id |
integer | Yes | Event identifier |
Provides data for public dashboards and live displays.
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
string | Yes | Action to perform (varies by endpoint) |
event_id |
integer | Conditional | Event ID for event-specific data |
Real-time notification system for competition events with CORS support.
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
string | No | Notification action type |
event_id |
integer | No | Event ID for event-specific notifications |
Manages saved configurations for start lists and summary tables.
| Action | Method | Description |
|---|---|---|
list |
GET | List all configurations |
get |
GET | Get specific configuration |
save |
POST | Save new configuration |
delete |
POST | Delete configuration |
Provides comprehensive heat flow chains, live progress, participant tracking, and real-time results integration.
| Parameter | Type | Required | Description |
|---|---|---|---|
event_id |
integer | Yes | Event identifier |
Manages heat settings, participant queues, and real-time heat operations.
| Action | Method | Parameters | Description |
|---|---|---|---|
get_data |
GET | event_id | Get heat management data |
update_settings |
POST | event_id, active_heat, active_run, bib_on_start | Update heat settings |
get_participants |
GET | event_id, heat_number | Get heat participants |
get_queue |
GET | event_id, heat_number, mode | Get participant queue |
update_participant_status |
POST | event_id, bib_number, status | Update participant status |
deactivate_all |
POST | event_id | Deactivate all heats |
Submit and manage judge scores with figure selection and diversity validation.
| Parameter | Type | Required | Description |
|---|---|---|---|
ajax |
string | Yes | Set to '1' for AJAX requests |
ep_id |
integer | Yes | Event participant ID |
heat_number |
integer | Yes | Heat number |
score_value |
float | No | Score value (null for no score) |
status |
string | Yes | Score status: 'scored', 'no_score', 'dns', 'dnf' |
figures_json |
JSON | No | Selected figures data |
Head judge operations for score management, approval, and oversight.
| Action | Parameters | Description |
|---|---|---|
get_scores |
ajax=1, action, event_id, heat_number, run_number | Get scores for review |
update_score |
ajax=1, action, score_id, score_value, status | Update existing score |
create_score |
ajax=1, action, ep_id, judge_id, score_value | Create new score |
approve_score |
ajax=1, action, score_id | Approve a score |
approve_all_participant |
ajax=1, action, participant_id | Approve all scores for participant |
Validates diversity rule compliance for participant scores and figure selections.
| Parameter | Type | Required | Description |
|---|---|---|---|
ep_id |
integer | Yes | Event participant ID |
judge_id |
integer | Yes | Judge ID |
event_id |
integer | Yes | Event ID |
heat_number |
integer | No | Heat number |
Comprehensive user management operations for administrators.
| Action | Method | Parameters | Description |
|---|---|---|---|
get_user |
GET | action, id | Get user details |
search_users |
GET | action, q | Search users |
update_user_status |
POST | action, user_id, status | Update user status |
bulk_action |
POST | action, user_ids[], bulk_action | Bulk operations (activate/deactivate/delete) |
Token system management for budget and transaction operations.
| Action | Method | Parameters | Description |
|---|---|---|---|
get_user_budget |
GET | action, user_id | Get user budget information |
get_transactions |
GET | action, user_id | Get user transactions |
create_budget |
POST | action, user_id | Create budget for user |
export_transactions |
GET | action, user_id | Export user transactions as CSV |
export_all_* |
GET | action | Various export options for system data |
Representative JSON responses, HTTP response codes, and concrete POST examples (fetch + cURL) for the most-used endpoints. These are samples — fields may vary by configuration. Use the interactive test buttons above to get live data for event_id = 3.
// Success
{ "success": true, "data": { ... } }
// Error examples
{ "success": false, "message": "Missing parameter: event_id" } // 400 Bad Request
{ "success": false, "message": "Unauthorized" } // 401 Unauthorized
{ "success": false, "message": "Forbidden" } // 403 Forbidden
{ "success": false, "message": "Internal server error" } // 500 Server Error
{
"event_id": 3,
"format": "standard",
"participants": [
{
"ep_id": 101,
"bib_number": 12,
"name": "Jane Doe",
"category": "Senior",
"heat": 1,
"run": 1,
"scores": {
"total": 27.5,
"details": [
{ "judge_id": 5, "value": 9.0 },
{ "judge_id": 6, "value": 9.5 },
{ "judge_id": 7, "value": 9.0 }
]
},
"place": 1,
"promotion": "auto"
}
]
}
{
"event_id":3,
"heats":[
{"heat_number":1,"participants":[{"bib":12,"name":"Jane Doe","lane":3}]}
]
}
{
"event_id":3,
"flows":[
{"flow_id":1,"name":"Prelims","heats":[{"heat_number":1,"runs":[1,2]}]},
{"flow_id":2,"name":"Finals","heats":[{"heat_number":5,"runs":[1]}]}
],
"live": {"active_heat":5,"active_run":1,"started_at":"2025-08-21T10:12:00Z"}
}
Endpoint: /admin/heat_management_api.php. Use action to select behavior. Many admin endpoints require an authenticated admin session.
const fd = new FormData();
fd.append('action','update_settings');
fd.append('event_id', 3);
fd.append('active_heat', 5);
fd.append('active_run', 1);
fd.append('bib_on_start', 1);
fetch('/v2/admin/heat_management_api.php', { method: 'POST', body: fd, credentials: 'include' })
.then(r => r.json())
.then(data => console.log(data));
update_settings (cURL)
curl -X POST \
-F "action=update_settings" \
-F "event_id=3" \
-F "active_heat=5" \
-F "active_run=1" \
-F "bib_on_start=1" \
--cookie "PHPSESSID=YOUR_SESSION" \
http://localhost/v2/admin/heat_management_api.php
update_participant_status (POST)
{
"action":"update_participant_status",
"event_id":3,
"bib_number":12,
"status":"on_deck" /* values: on_deck, started, finished, dns, dnf */
}
deactivate_all (POST)
curl -X POST -F "action=deactivate_all" -F "event_id=3" --cookie "PHPSESSID=YOUR_SESSION" http://localhost/v2/admin/heat_management_api.php
Endpoint: /judge/score.php. Use ajax=1 for AJAX handlers. Score submissions require an authenticated judge session.
const form = new URLSearchParams();
form.append('ajax', 1);
form.append('ep_id', 101);
form.append('heat_number', 1);
form.append('score_value', 9.5);
form.append('status', 'scored');
form.append('figures_json', JSON.stringify({ figures:[{id:1,value:9.5}] }));
fetch('/v2/judge/score.php', { method: 'POST', body: form, credentials: 'include' })
.then(r => r.json())
.then(data => console.log(data));
Overwrite score (AJAX) — fetch example
const fd = new FormData();
fd.append('ajax',1);
fd.append('overwrite_score_id', 999);
fd.append('score_value', 9.8);
fetch('/v2/judge/score.php', { method:'POST', body: fd, credentials:'include' })
.then(r=>r.json()).then(console.log);
Minimal score POST (cURL, form)
curl -X POST \
-d "ajax=1" \
-d "ep_id=101" \
-d "heat_number=1" \
-d "score_value=9.5" \
-d "status=scored" \
-d "figures_json={\"figures\":[{\"id\":1,\"value\":9.5}]}" \
--cookie "PHPSESSID=YOUR_SESSION" \
http://localhost/v2/judge/score.php
Endpoint: /judge/head_judge.php. Use ajax=1 and action parameter. Head Judge endpoints require head_judge or admin role.
fetch('/v2/judge/head_judge.php', {
method: 'POST',
body: new URLSearchParams({ ajax:1, action: 'get_scores', event_id:3, heat_number:1 }),
credentials: 'include'
}).then(r=>r.json()).then(console.log);
update_score (cURL JSON)
curl -X POST http://localhost/v2/judge/head_judge.php \
-H "Content-Type: application/json" \
--data '{"ajax":1,"action":"update_score","score_id":555,"score_value":9.2,"status":"scored"}' \
--cookie "PHPSESSID=YOUR_SESSION"
approve_all_participant (fetch)
fetch('/v2/judge/head_judge.php', {
method:'POST',
body: new URLSearchParams({ ajax:1, action:'approve_all_participant', participant_id:101 }),
credentials:'include'
}).then(r=>r.json()).then(console.log);
{
"ep_id":101,
"violations":[],
"valid":true,
"message":"OK"
}
/* User search (GET) */
{ "users": [{"id":12,"username":"jdoe","role":"judge","status":"active"}] }
/* Token get_user_budget (GET) */
{ "user_id":12, "budget":150, "currency":"tokens" }
/* Token create_budget (POST) example */
{ "action":"create_budget", "user_id":12, "amount":100 }
{
"notifications":[ {"id":1,"event_id":3,"title":"Heat started","body":"Heat 5 run 1 has started","level":"info"} ]
}
// Dashboard data (GET)
fetch('/v2/api/public_dashboard_api.php?action=event_summary&event_id=3')
.then(r=>r.json()).then(console.log);
Want cURL snippets added as clickable buttons or a separate "try POST" area? I can add them, but note POST endpoints require authentication and may modify live events — I will add warnings and an optional demo mode if you want.
// Fetch summary table data
fetch('/v2/api/summary_table_api.php?event_id=3&category=all')
.then(response => response.json())
.then(data => {
console.log('Summary data:', data);
// Process the results
})
.catch(error => console.error('Error:', error));
// Get start list for specific heat
fetch('/v2/api/start_list_api.php?event_id=3&heat_number=1')
.then(response => response.json())
.then(data => {
console.log('Start list:', data);
});
'list']));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
?>
# Get summary table data
$response = Invoke-RestMethod -Uri "http://localhost/v2/api/summary_table_api.php?event_id=3"
$response | ConvertTo-Json -Depth 10
# Get start list with specific parameters
$uri = "http://localhost/v2/api/start_list_api.php?event_id=3&heat_number=1&format=json"
$startList = Invoke-RestMethod -Uri $uri
Write-Host "Retrieved $($startList.count) participants"
# Download CSV format
Invoke-WebRequest -Uri "http://localhost/v2/api/summary_table_api.php?event_id=3&format=csv" -OutFile "results.csv"
{"success": false, "message": "No event ID provided"}{"success": false, "message": "Event not found"}{"success": false, "message": "Database connection failed"}{"success": false, "message": "Invalid action"}success field in responses