Spaces:
Running on T4
Running on T4
|
Download backend/docs/reference/frontend_spec_examples.md from modventures/baseball-engine: direct link, hf CLI and curl.
- Browser
- Download file 1.91 kB
-
https://huggingface.co/spaces/modventures/baseball-engine/resolve/fe40b87ae08cb37d62b88a8e607f4dfd9282afba/backend/docs/reference/frontend_spec_examples.md
- Command line
-
hf download hf://spaces/modventures/baseball-engine@fe40b87ae08cb37d62b88a8e607f4dfd9282afba/backend/docs/reference/frontend_spec_examples.md
-
curl -L -o frontend_spec_examples.md https://huggingface.co/spaces/modventures/baseball-engine/resolve/fe40b87ae08cb37d62b88a8e607f4dfd9282afba/backend/docs/reference/frontend_spec_examples.md
1.91 kB
| # JSON examples from the frontend spec (camelCase there; our API uses snake_case for the same fields) | |
| A1 register request/response: | |
| { "email": "ahmed@example.com", "password": "correct-horse-9", "role": "player" } | |
| 201 { "user": { "id", "email", "role": "player", "focus": "both", | |
| "profile": { "name": "", "age": null, "heightCm": null, "weightKg": null, "bats": "R", "throws": "R", "level": "High school" }, | |
| "unit": "imperial", "plan": "free", "privateVideos": true, "teamCode": null, "createdAt" }, | |
| "tokens": { "accessToken", "refreshToken", "expiresIn": 3600 } } | |
| Error: { "error": { "code": "EMAIL_TAKEN", "message": "An account with this email already exists." } } | |
| B1 GET /me: | |
| { "user": {...same as A1 user...}, | |
| "team": { "code": "KDA-4821", "name": "Karachi Diamond Academy", "coachId", "coachName": "Imran Baig", "coaching": "both", "createdAt" }, | |
| "entitlement": { "plan": "free", "weeklyLimit": 3, "usedThisWeek": 1, "left": 2, "windowDays": 7 } } | |
| B2 PATCH /me request (all optional): | |
| { "role": "coach", "focus": "h", "unit": "metric", "privateVideos": false, | |
| "profile": { "name": "Ahmed Rehman", "age": 15, "heightCm": 168, "weightKg": 60, "bats": "R", "throws": "R", "level": "High school" } } | |
| D2 POST /sessions request: | |
| { "uploadId": "u9...", "thumbUploadId": "u10...", "mode": "h", "isSelf": true, "athlete": null, "durationSec": 3.87, "fps": 30, | |
| "marks": { "contactFrame": 84, "contactOffset": -2, "contactSource": "detected", "strideStartFrame": 58, "strideEndFrame": 79, | |
| "pitcherDir": { "from": [0.56, 0.86], "to": [0.90, 0.64] } }, | |
| "clientCreatedAt": "2026-10-22T10:12:03Z" } | |
| F1 roster item: | |
| { "id", "name": "Ahmed Rehman", "email", "focus": "h", "level": "High school", "joinedAt", "pendingCount": 1, | |
| "last": { "h": { "sessionId", "score": 71, "delta": 3, "createdAt", "topFix": "Pelvis load" }, "p": null }, | |
| "recent": { "h": [71, 68, 69] } } | |