Developer Hub • /developers

Tích hợp REST API & Bearer Token

Sử dụng Session Token hiện tại của bạn hoặc X-API-Key để tự động hóa việc tải lên, liệt kê và tải xuống tệp từ terminal hoặc ứng dụng CI/CD bên ngoài.

1. Liệt kê danh sách tệp (theo quyền User/Admin)

GET /api/files
curl -s "http://localhost:8080/api/files" \
  -H "Authorization: Bearer <YOUR_BEARER_TOKEN>"

2. Tải tệp mới lên Upload ThTuanIT (Turbo Upload)

POST /api/upload
curl -X POST "http://localhost:8080/api/upload" \
  -H "Authorization: Bearer <YOUR_BEARER_TOKEN>" \
  -F "path=media/video.mp4" \
  -F "file=@./video.mp4"

3. Đổi tên / Di chuyển đường dẫn tệp (Zero-Copy Hash)

PUT /api/files
curl -X PUT "http://localhost:8080/api/files" \
  -H "Authorization: Bearer <YOUR_BEARER_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"old_path":"media/video.mp4","new_path":"archive/video-2026.mp4"}'

4. Tải tệp xuống hoặc Streaming HTTP Range

GET /api/download
curl -L "http://localhost:8080/api/download?path=111.mp4" \
  -H "Authorization: Bearer <YOUR_BEARER_TOKEN>" \
  -o 111.mp4