Get file list
| Properties | Values |
|---|---|
| HTTP methods | GET |
| Interface path | /nd/api/file/list_dir |
| Category | File API |
Interface description
Interface path: /nd/api/file/list_dir
HTTP method: GET
HTTP method: GET
URL parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
parent_id |
string |
Yes | Parent folder ID: 1 enterprise folder, 2 personal folder, 3 my projects, 4 shares I joined; other fileId values identify folders. |
page_size |
number |
Not specified | Items per page |
page |
number |
Not specified | Zero-based requested page number: 0 is the first page and 1 is the second. |
type |
string |
Not specified | 1 - file, 2 - folder, 0 - all |
Scroll horizontally to view all columns
Return field description
| Field | Type | Description |
|---|---|---|
files |
array | File information (source names fileId and name; remaining fields are unspecified) |
total |
int |
Total count |
pages |
int |
Current total number of pages, distinct from the requested page number in page. |
success |
boolean |
Success flag |
code |
int |
Error code; 0 indicates success |
Scroll horizontally to view all columns
The requested page number page differs from the total page count pages. For example, pages: 3 corresponds to request page numbers 0, 1 and 2. This defines the starting index, not the default behavior when page is omitted.
Call instructions
- Before calling, you need to complete Get token or the corresponding login-free authentication, and carry
Authorization: Bearer <access_token>in the request header. - If there are differences in parameters and return fields due to deployment versions, the actual private cloud API documents and joint debugging results should prevail.
- Category: File API.