English
Fx.netdisk
About 1162 wordsAbout 4 min
2026-01-09
Function Categories
Table of Contents
Summary
The overview of this document is as follows: Used to export npath path information for cloud drive files.
File Export Module
Used to export npath path information for cloud drive files.
| Method Name | Description | Syntax |
|---|---|---|
| exportNpathByFolderId | Export cloud drive npath | Fx.netdisk.exportNpathByFolderId(...) |
exportNpathByFolderId
Function: Export cloud drive npath.
Syntax: Fx.netdisk.exportNpathByFolderId(String nodeCategory, Array folderIDs, String employeeId)
Request parameters:
Input:
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| nodeCategory | String | Folder type (company, personal, shared) | Y |
| folderIDs | Array[String] | Folder ID list | Y |
| employeeId | String | Employee ID | Y |
Return value: (Boolean isError, Map data, String message) - Returns the operation result, including error status, data, and message.
| Parameter Name | Type | Description |
|---|---|---|
| isError | Boolean | Whether an error occurred |
| data | Map | Returned data |
| message | String | Message |
data structure:
| Parameter Name | Type | Description |
|---|---|---|
| fileMessageInfos | Map | File information mapping |
fileMessageInfos structure:
| Parameter Name | Type | Description |
|---|---|---|
| FileId | List[Map] | File information list |
File information object:
| Parameter Name | Type | Description |
|---|---|---|
| nPath | String | File npath |
| fileName | String | File name |
| fileSize | Integer | File size |
| fileExtension | String | File extension |
Return example:
{
"isError" : false,
"data" : {},
"message" : ""
}Example:
def (Boolean error, Map data, String message) = Fx.netdisk.exportNpathByFolderId("Company", ["476d9244b9304c8abfde59d0f8274933","903d7c1172e24d4198136ebfada198a1"], 1000)
if (error) {
log.info("error :" + message)
} else {
log.info(data['fileMessageInfos'])
}Notice:
- Multiple folder IDs can be entered. The output files are the npaths of all files under those folders.
File Query Module
Used to query and list cloud drive folder content.
| Method Name | Description | Syntax |
|---|---|---|
| list | List the cloud drive folder | Fx.netdisk.list(...) |
list
Fx.netdisk.list(String nodeCategory, String dir, String order, Integer desc, Integer start, Integer limit, Integer folder, Integer showEmpty, String employeeId)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| nodeCategory | String | Folder type (company, personal, shared) | Y |
| dir | String | Folder name | Y |
| order | String | Sort field (name, time, size; defaults to name) | Y |
| desc | Integer | Default ascending order; set to 1 for descending order | Y |
| start | Integer | Pagination start position (0-based) | Y |
| limit | Integer | Number of items to query (default: 1000, recommended maximum: 1000) | Y |
| folder | Integer | Whether to return only folders (0: return all, 1: return only folders with path field) | Y |
| showEmpty | Integer | Whether to return dir_empty attribute (0: no, 1: yes) | Y |
| employeeId | String | Employee ID | Y |
Return Parameters
| Parameter Name | APIResult | Description |
|---|---|---|
| isError | boolean | Indicates whether an error exists |
| data | object | Returned data |
| message | string | Message |
| data | object | Returned data |
|---|---|---|
| emptyDir | boolean | Indicates if it's an empty directory |
| fileMessageInfos | array[object] | List of file information |
| folderMessageInfos | array[object] | List of folder information |
| fileMessageInfos | object | Description |
|---|---|---|
| fileExtension | string | File extension |
| fileName | string | File name |
| fileSize | integer | File size |
| nPath | string | File path |
| folderMessageInfos | object | Description |
|---|---|---|
| fileSize | integer | Folder size |
| folderName | string | Folder name |
Return an example
{
"isError": false,
"data": {
"emptyDir": false,
"fileMessageInfos": [
{
"fileExtension": "txt",
"fileName": "example.txt",
"fileSize": 2048,
"nPath": "/files/example.txt"
},
{
"fileExtension": "jpg",
"fileName": "image.jpg",
"fileSize": 4096,
"nPath": "/files/image.jpg"
}
],
"folderMessageInfos": [
{
"fileSize": 0,
"folderName": "Documents"
},
{
"fileSize": 0,
"folderName": "Images"
}
]
},
"message": "success"
}Code examples
String nodeCategory = "Company"
String dir = "Alibaba Java Development Manual"
String orderField = "name"
Integer desc = 1
Integer start = 0
Integer limit = 10
Integer folder = 0
Integer showEmpty = 1
Integer employeeId = 1017
def(Boolean error, Map data, String message) = Fx.netdisk.list(nodeCategory, dir, orderField, desc, start, limit, folder, showEmpty, employeeId)
if (error) {
log.info("error:" + message)
} else {
List fileMessageInfos = data["fileMessageInfos"] as List
log.debug(fileMessageInfos)
}Notice
- The user must have access permissions to this folder.
File Save Module
Used to save files to a specified cloud drive folder.
| Method Name | Description | Syntax |
|---|---|---|
| saveFileToDir | Save the file to a specified folder in the cloud drive | Fx.netdisk.saveFileToDir(...) |
saveFileToDir
Fx.netdisk.saveFileToDir(Array departmentIds, String path, String fileName, Integer category, String folderPath, Boolean autoCreateDir, Boolean allowReName, Boolean takeOwnership)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| departmentIds | array[string] | User's department IDs | Y |
| path | string | File path to be saved in the cloud drive (currently only enterprise file types are supported) | Y |
| fileName | string | File name with extension | Y |
| category | integer | Cloud drive folder type: 1-Company, 2-Personal, 3-Shared (Shared type is currently not supported) | Y |
| folderPath | string | Cloud drive folder path, starting with '/' and ending with folder name | Y |
| autoCreateDir | boolean | Whether to automatically create missing directories iteratively | Y |
| allowReName | boolean | Whether to allow incremental renaming of files | Y |
| takeOwnership | boolean | Privilege escalation operation to obtain cloud drive administrator permissions | Y |
Return Parameters
| Parameter Name | APIResult | Description |
|---|---|---|
| isError | boolean | Whether an error occurred |
| data | object | |
| message | string | Response message |
| data | object | Description |
|---|---|---|
| fileName | string | File name |
| ei | string | Enterprise ID |
| employeeId | integer | Employee ID |
| ea | string | Enterprise account |
| allowReName | boolean | Whether renaming is allowed |
| folderId | string | Folder ID |
| fileId | string | File ID |
Return an example
{
"isError": false,
"data": {
"fileName": "sonar-project",
"ei": "90325",
"employeeId": 1000,
"ea": "90325",
"allowReName": true,
"folderId": "339cf3396af84405bd9171947cd0b5ef",
"fileId": "3e2beed837e04df185e1683b43cbf17b"
},
"message": "success"
}Code examples
// Department IDs the user belongs to (can be empty, used when ordinary users need to save files to department folders)
List<Integer> departmentIds;
// Path of the file to be saved to the cloud drive (currently only enterprise files are supported, i.e., files prefixed with N_ or TN_)
String path = "N_202304_10_f438201727394b018e62e0ba48b6f349.pdf";
// File name (must include the file extension; total file name length must not exceed 128 characters, and extension length must not exceed 20 characters)
String fileName = "test15.pdf";
// Cloud drive folder type (1: Company, 2: Personal, 3: Shared; currently, saving to shared folders is not supported)
Integer category = 1;
// File path (absolute path, must start with / and end with the file name; supports up to 9 nested levels)
String folderPath = "/2023/04/10/Contract";
// Whether to automatically create missing directories in the path (default: false)
Boolean autoCreateDir = true;
// Whether to allow incremental renaming of files (e.g., test.pdf -> test(1).pdf, incrementing sequentially; default: false)
Boolean allowReName = true;
// Override permission to obtain cloud drive administrator privileges (used for ordinary users to save files to company folders; use with caution!!!)
Boolean takeOwnership = false;
def (boolean error, Map data, String message) = Fx.netdisk.saveFileToDir(departmentIds, path, fileName, category, folderPath, autoCreateDir, allowReName, takeOwnership);
if (error) {
log.info("error:" + message)
} else {
log.info("data:" + data)
}Changelog
| Version | Date | Changes | Author |
|---|---|---|---|
| v1.0 | 2026-05-20 | Initial version |
Background
This document provides detailed information about the Fx.netdisk API functionality and usage, helping developers integrate relevant capabilities.
Applicable Scenarios
Specific applicable scenarios are determined by actual business needs. Developers can select the appropriate API for integration as required.
Prerequisites
- Access to Fxiaoke Open Platform
- Application authorization and configuration completed
- Basic knowledge of relevant business domain
Steps
Please refer to the detailed instructions for each API.
Notes
- Ensure prerequisites are met before calling APIs
- Pay attention to API call frequency limits
- Refer to error code documentation for exception handling
Compatibility note: This version currently has no deprecated or compatibility notes.
