docs: add thumbnail endpoint to 08_media.md

This commit is contained in:
Accusys
2026-05-22 04:58:43 +08:00
parent d67f123949
commit 6378d7be89
3 changed files with 296 additions and 0 deletions

View File

@@ -85,6 +85,28 @@ curl -s "$API/api/v1/file/$FILE_UUID/trace/1939/representative-face" \
#### Error Responses
---
### `GET /api/v1/file/:file_uuid/trace/:trace_id/thumbnail`
Extract the best face image for a trace as JPEG (320×320). Internally selects the face using the same two-stage algorithm as `representative-face`, then crops via FFmpeg. The result is cacheable for 24 hours.
**Auth**: Required
**Scope**: file-level
#### Example
```bash
curl -s "$API/api/v1/file/$FILE_UUID/trace/1939/thumbnail" \
-H "X-API-Key: $KEY" -o trace_1939_face.jpg
```
#### Response
- **200**: `image/jpeg` binary data (320×320 cropped face)
- **404**: File, trace not found, or no suitable face
- **500**: FFmpeg or database error
| HTTP | When |
|------|------|
| `404` | File, trace not found, or no suitable face |