Skip to content

Référence de l'API REST ​

Informations de Base ​

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

Réponse Commune ​

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

Points d'Accès ​

Connexion Administrateur ​

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

Lister les Périphériques ​

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

Créer un Espace ​

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

Lister les Fichiers ​

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

Télécharger un Fichier ​

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

Télécharger un Fichier ​

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

Codes d'Erreur ​

CodeSignification
0Succès
40001Paramètres invalides
40002Échec d'authentification
40003Permissions insuffisantes
40004Ressource non trouvée
50001Erreur interne du serveur

Apache License 2.0