Skip to content

REST API Reference ​

Base Info ​

  • Base URL: http://localhost:5212/api/v3
  • Auth: JWT Bearer Token
  • Format: JSON

Common Response ​

json
{"code": 0, "message": "success", "data": {}}

Endpoints ​

Admin Login ​

http
POST /api/v3/admin/login
Content-Type: application/json
{"username": "admin", "password": "your-password"}

List Devices ​

http
GET /api/v3/device
Authorization: Bearer <token>

Create Space ​

http
POST /api/v3/space
Authorization: Bearer <token>
Content-Type: application/json
{"name": "My Space", "total_size": 1073741824, "device_id": "ram_0"}

List Files ​

http
GET /api/v3/space/:id/files?path=/&page=1&page_size=50
Authorization: Bearer <token>

Upload File ​

http
POST /api/v3/space/:id/files?path=/
Authorization: Bearer <token>
Content-Type: multipart/form-data
file: <file>

Download File ​

http
GET /api/v3/space/:id/files/:fileId
Authorization: Bearer <token>

Error Codes ​

CodeMeaning
0Success
40001Invalid parameters
40002Authentication failed
40003Insufficient permissions
40004Resource not found
50001Internal server error

Apache License 2.0