API Documentation

API Developer Documentation

KCloud provides a complete RESTful API, enabling developers to integrate cloud storage functionality into their own applications.

Authentication

All API requests must include an authentication token in the header:

Authorization: Bearer YOUR_API_TOKEN
POST /api/v1/auth/token

Obtain an access token

{ "email": "user@example.com", "password": "your_password" }

Response Example:

{ "access_token": "eyJhbGciOiJIUzI1NiIs...", "token_type": "Bearer", "expires_in": 3600 }

Upload Files

POST /api/v1/files/upload

Upload file to cloud

curl -X POST https://api.kcloud.com/v1/files/upload \ -H "Authorization: Bearer YOUR_TOKEN" \ -F "file=@/path/to/file.pdf" \ -F "folder=/documents"

Download Files

GET /api/v1/files/download/:file_id

Download specified file

List Files

GET /api/v1/files/list

Get current user's file list

{ "files": [ { "id": "file_123", "name": "document.pdf", "size": 1024000, "created_at": "2024-01-01T10:00:00Z" } ], "total": 1 }

Delete Files

DELETE /api/v1/files/:file_id

Delete specified file

Rate Limits

Free Plan: 100 requests/hour
Professional: 1000 requests/hour
Enterprise: Unlimited

Error Codes

Status Code Description
200 Request successful
400 Bad request parameters
401 Unauthorized
429 Rate limit exceeded
500 Server error