General Instructions
Authentication
File Management APIs require a Cookie (containing userName, TMSESSNAME) and the X-Csrf-Token header.
| Endpoint | Authentication Requirement |
|---|---|
| All File Management APIs | Login required, CSRF Token required |
DELETE /fileManage/folder/del | Cookie only, no CSRF |
Placeholder Note: In examples,
{ip}is the NAS IP address and{port}is the web service port (default: 5443).
Request Format
- Data format: JSON, UTF-8
- GET requests: Parameters via Query String
- POST/DELETE requests: Parameters via Request Body (JSON)
- File upload:
multipart/form-data
Unified Response Format
{
"code": true,
"code_num": 0,
"code_msg": "",
"msg": "",
"data": {},
"is_login": true,
"time": 0.0
}
| Field | Type | Description |
|---|---|---|
| code | boolean | Request success flag: true = success, false = failure |
| code_num | integer | Business status code: 0 = success, non-zero = error |
| code_msg | string | Description for the business error code |
| msg | string | Error message; empty on success |
| data | object/array | Returned data payload |
| is_login | boolean | User login status: true = logged in |
| time | number | Server processing time (seconds) |
Error Code Reference
The following business error codes may be returned by the File Management APIs:
| code_num | code_msg | Description |
|---|---|---|
| 0 | OK | Request successful |
| 21 | invalid argument | Invalid parameter |
| 24 | missing session | Missing session credential |
| 27 | account has been disabled | Account has been disabled |
| 33 | not empty | Resource not empty, operation cannot proceed |
| 34 | source path can not be used | Source path is unavailable |
| 35 | source path already exist | Source path already exists |
| 90 | permission denied | Permission denied |
| 104 | path does not exist | Path does not exist |
| 117 | please login | Please log in first |
| 118 | name already exists | Name already exists |
| 126 | Read-only file system | File system is read-only |