API call description
When obtaining file or folder information, the file size and file extension are not returned for folder-type entries.Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/storage/spaces/{spaceId}/dentries/{dentryId}/query |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Permission required | permission-Storage.File.Read-Read permission on organization 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 id parameter value. |
| dentryId | String | Yes | The file or folder ID. Call the Get a list of files or folders API or the Get spaceId and dentryId by dentryUuid API to obtain the id parameter value. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| unionId | String | Yes | The unionId of the operator. Call the Query user details API to obtain the unionid parameter value. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| option | Object | No | Optional parameters. |
| appIdsForAppProperties | Array of String | No | Returns the corresponding visible properties by specifying the space ownerId list. Maximum: 20. - When ownerType is APP, ownerId is the app identifier. - When ownerType is USER, ownerId is the creator’s unionId. |
| withThumbnail | Boolean | No | Whether to obtain a temporary link to the file thumbnail. Obtain on demand because it affects API latency. - true: Obtain. - false (default): Do not obtain. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| dentry | Object | File or folder information. |
| id | String | The file or folder ID. |
| spaceId | String | The ID of the space where the file or folder resides. |
| parentId | String | The parent folder ID. For the root folder, this parameter is 0. |
| type | String | The type: - FILE: File. - FOLDER: Folder. |
| name | String | The file or folder name. If it is a file, this field value includes the file extension. |
| size | Long | The file size, in bytes. This field is not returned for folders. |
| path | String | The path of the file or folder within the space. |
| version | Long | The version. |
| status | String | The status: - NORMAL: Normal. - DELETED: Trash. - EXPIRED: Expired. |
| extension | String | The file extension. This field is not returned for folders. |
| creatorId | String | The unionId of the creator. |
| modifierId | String | The unionId of the modifier. |
| createTime | String | The creation time in ISO 8601 format. Example: 2022-07-29T14:55Z. |
| modifiedTime | String | The modification time in ISO 8601 format. Example: 2022-07-29T14:55Z. |
| properties | Object | The file or folder attributes. |
| readOnly | Boolean | Whether the file or folder is read-only: - true: Yes. - false: No. |
| appProperties | Map<String, Array> | Attributes on a specific app. The key is the space identifier, and the value is the attribute list. |
| Array | The attribute list. | |
| 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 business identifier. |
| 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 | Thumbnail information. |
| width | Integer | The thumbnail width, in pixels. |
| height | Integer | The thumbnail height, in pixels. |
| url | String | The thumbnail URL. |
Response body example
Error codes
If an error is returned 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 does not have permission to obtain the file or folder information. |
| 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. |