Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/storage/spaces/{spaceId}/dentries/listAll |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Permissions required | permission-Storage.File.Read-Read permission for organization storage files |
Request header
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential for calling this API. Obtain it as follows: - For an internal app, call the Obtain the access token of an internal app API. - For a third-party enterprise app, call the Obtain the access token of an authorized organization for a third-party app API. |
Path parameter
| Name | Type | Required | Description |
|---|---|---|---|
| spaceId | String | Yes | The space ID. Call the Add a space API and use the value of the returned id parameter. |
Query parameter
| Name | Type | Required | Description |
|---|---|---|---|
| unionId | String | Yes | The unionId of the operator. Call the Query user details API to obtain it. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| option | Object | No | Optional parameters. |
| nextToken | String | No | The pagination cursor. - For the first call, do not pass this parameter. - For subsequent calls, pass the nextToken returned in the previous call. |
| maxResults | Integer | No | The number of entries per page. Default: 50. Maximum: 50. |
| order | String | No | Sorting rules. Currently, only sorting by modified time is supported. - ASC (default): ascending order - DESC: descending order - When sorting in ascending order, if files change during pagination, duplicate data may be retrieved. - When sorting in descending order, if files change during pagination, data may be lost. |
| withThumbnail | Boolean | No | Whether to retrieve thumbnail links of files. - true: Yes - false (default): No Retrieve on demand. Retrieving thumbnails increases API response time. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| dentries | Array | The returned list of files or folders. |
| id | String | The file or folder ID. |
| spaceId | String | The ID of the space the file or folder belongs to. |
| parentId | String | The parent folder ID. The root folder ID is 0. |
| type | String | The type. - FILE: file - FOLDER: folder |
| name | String | The file or folder name. |
| size | Long | The file size, in bytes. |
| path | String | The file or folder path. |
| version | Long | The file version. |
| status | String | The status of the file or folder. - NORMAL: normal - DELETED: deleted - EXPIRED: expired |
| extension | String | The file extension. |
| creatorId | String | The unionId of the creator. |
| modifierId | String | The unionId of the modifier. |
| createTime | String | The created time, in ISO 8601 format. Example: 2022-07-29T14:55Z. |
| modifiedTime | String | The modified time, in ISO 8601 format. Example: 2022-07-29T14:55Z. |
| properties | Object | The file attributes. |
| readOnly | Boolean | Whether the file is read-only. - true: Yes - false: No |
| appProperties | Map<String, Array> | Attributes for a specific app. |
| Array | The list of space attributes. | |
| name | String | The attribute name. |
| value | String | The attribute value. |
| visibility | String | The attribute visibility. - PUBLIC: visible to all apps - PRIVATE: visible only to the current app |
| uuid | String | The identifier field. |
| partitionType | String | The storage partition. - PUBLIC_OSS_PARTITION: public cloud OSS storage partition - MINI_OSS_PARTITION: dedicated Mini OSS storage partition |
| storageDriver | String | The driver type. - DINGTALK: DingTalk unified storage driver - ALIDOC: DingTalk Docs storage driver - SHANJI: Flash Note storage driver - UNKNOWN: unknown driver |
| thumbnail | Object | The thumbnail information. Returned only when the withThumbnail parameter is set to true. |
| width | Integer | The thumbnail width, in px. |
| height | Integer | The thumbnail height, in px. |
| url | String | The thumbnail URL. |
| nextToken | String | The pagination cursor. If this parameter is not empty, more data is available. |
Response body example
Error codes
If an error occurs when you call this API, refer to the Global error codes document for solutions based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | paramError | %s | Parameter error |
| 403 | permissionDenied | %s | The user lacks permission to retrieve the file list |
| 404 | spaceNotExist | %s | The space does not exist |
| 404 | dentryNotExist | %s | The file does not exist |
| 500 | systemError | %s | System error |
| 500 | unknownError | Unknown Error | Unknown error |
| 503 | operationTimeout | %s | Request timeout |