Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/storage/spaces/{spaceId}/dentries |
| HTTP Method | GET |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | permission-Storage.File.Read-Read permission for enterprise storage files |
Request headers
| 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 Get the access token of an internal app API. - For a third-party enterprise app, call the Get the access token of an enterprise authorized to a third-party app API. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| spaceId | String | Yes | The space ID. Call the Add a space API to obtain the value of the id parameter. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| parentId | String | Yes | The parent directory ID. For the root directory, set this parameter to 0. Call the Get the list of files or folders API to obtain the value of the parentId parameter. |
| nextToken | String | No | The pagination cursor. - Leave this parameter empty for the first call. - For subsequent calls, pass the nextToken returned by the previous call. |
| maxResults | Integer | No | The number of entries per page. The maximum value is 50. |
| orderBy | String | No | The sorting field. - MODIFIED_TIME: last modified time. Default value. - CREATE_TIME: created time. - NAME: name. - SIZE: size. |
| order | String | No | The sorting rule. - ASC: ascending order. - DESC: descending order. Default value. |
| withThumbnail | Boolean | No | Whether to get the temporary link of the file thumbnail. Get it as needed because it affects API response time. - true: get. - false: do not get. Default value. |
| unionId | String | Yes | The unionId of the operator. Call the Query user details API to obtain it. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| dentries | Array | The list of files or folders. |
| id | String | The ID of the file or folder. |
| spaceId | String | The ID of the space where the file or folder is located. |
| parentId | String | The parent directory ID. For the root directory, this parameter is 0. |
| type | String | The type. - FILE: file. - FOLDER: folder. |
| name | String | The name of the file or folder. |
| size | Long | The file size, in bytes. |
| path | String | The path of the file or folder. |
| version | Long | The version. |
| status | String | The status. - 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. For example, 2022-07-29T14:55Z. |
| modifiedTime | String | The modified time in ISO 8601 format. For example, 2022-07-29T14:55Z. |
| properties | Object | The property information. |
| readOnly | Boolean | Whether the file or folder is read-only. - true: yes. - false: no. |
| appProperties | Map<String, Array> | The properties for a specific app. |
| Array | The list of space properties. | |
| name | String | The property name. |
| value | String | The property value. |
| visibility | String | The visibility. - PUBLIC: public. - PRIVATE: visible only to the current space. |
| uuid | String | The identifier field. |
| partitionType | String | The storage partition. - PUBLIC_OSS_PARTITION: public cloud OSS storage partition. - MINI_OSS_PARTITION: dedicated MiniOSS storage partition. |
| storageDriver | String | The driver type. - DINGTALK: DingTalk unified storage driver. - ALIDOC: DingTalk Docs storage driver. - UNKNOWN: unknown driver. |
| thumbnail | Object | The thumbnail information. |
| width | Integer | The thumbnail width, in pixels. |
| height | Integer | The thumbnail height, in pixels. |
| url | String | The thumbnail URL. |
| nextToken | String | The pagination cursor. A non-empty value indicates that more data is available. |
Response body example
Error codes
If an error occurs when you call this API, look up the solution in the Global error codes document based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | paramError | %s | Parameter error. |
| 403 | permissionDenied | %s | The user lacks permission to get 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 timed out. |