tencent cloud

Smart Media Hosting

Product Introduction
Product Overview
Feature Description
Product Strengths
Use Cases
Basic Concept
Purchase Guide
Quick Start
Create Media Library
Initiate request
Service Level API Document
History
Introduction
API Category
Making API Requests
PaaS Service APIs
Official Cloud Disk APIs
Data Types
Error Codes
Business Level API Document
Introduction
Access Token Operation API
Tenant Space Operation API
File Operation API
Directory or Album Operation API
Recycle Bin Operation API
Quota Operation API
Query Task Operation API
Search Operation API
Historical Version Operations API
Directory and File Batch Operation API
Collection Operation API
Error Codes
SDK Documentation
Android SDK
iOS SDK
HarmonyOS SDK
FAQs
Enterprise Network Disk
Product Introduction
Purchase Guide
Quick Start
FAQs
Service Level Agreement
Glossary

View Directory or Album

PDF
Focus Mode
Font Size
Last updated: 2026-01-07 14:52:05

Description

View directory or album details
Note:
This interface can be used to view details of files or folders. If the path points to a file, it returns file details; if it points to a folder, it returns folder details.

Request

Request Example

GET /api/v1/directory/`{LibraryId}`/`{SpaceId}`/`{DirPath}`?info&with_inode=`{WithInode}`&access_token=`{AccessToken}`&with_favorite_status=`{WithFavoriteStatus}`

Request Parameter

Request parameters.
Description
Type
Required or Not
LibraryId
Media Library ID, obtained after creating a media library in the media hosting console. See create media library
String
Yes
SpaceId
Space ID. If the media library is in single-tenant mode, this parameter is fixed as a hyphen (-). If the media library is in multi-tenant mode, you must specify this parameter. For retrieval, please refer to create tenant space.
String
No
DirPath
directory path or album name. For multi-level directories, use a slash (/) to separate, such as foo/bar; for the root directory, leave this parameter blank.
String
No
WithInode
0 or 1, whether to return inode (file directory ID), default do not return
String
No
AccessToken
Access token. For Public Read Media Library or tenant space, this parameter is not specified, otherwise must specify this parameter. See generate access token
String
No
WithFavoriteStatus
0 or 1, whether to return favorite status, default do not return
String
No

Request Body

This request does not have a request body.

Response

Response code

Successfully obtained, returning HTTP 200 OK.

Response Body

application/json
Response body example:
{
"path":["xxx","yyy"],
"name": "file1.jpg",
"type": "file",
"userId": "23",
"creationTime": "2020-09-22T07:44:45.000Z",
"modificationTime": "2020-09-22T07:44:45.000Z",
"contentType": "image/jpg",
"size": "1048576",
"eTag": "\\"b581c674266a2b0ff16a9505b4c52300\\"",
"crc64": "16293198345556339838",
"versionId": 23,
"historySize": "2323",
"metaData": {
"x-smh-meta-foo": "bar"
},
"previewByDoc": true,
"previewByCI": true,
"previewAsIcon": true,
"fileType": "powerpoint",
"localSync": {
"syncId": 4,
"strategy": "local_to_cloud",
"isSyncRootFolder": true,
"syncUserId": "123"
}
}
Response body field description:
Response Parameters
Description
Type
path
full path
Array
inode
File directory ID
String
name
directory or album name or file name
String
type
Entry type
dir: directory or album
file: file, only used for file type media library
image: image, only used for media type media library.
video: video, only used for media type media library.
symlink: symbolic link.
String
userId
Creator ID
String
creationTime
ISO 8601 formatted date and time string, indicating the creation time of a directory or album or the upload time of a file, such as 2020-10-14T10:17:57.953Z
String
modificationTime
The last time the file was overwritten, or the last time a subdirectory or file was added or removed in the directory
String
contentType
Media type (returned for non-directory or non-album only)
String
size
File size.
String
eTag
eTag of directory or file
String
isFavorite
Whether it is a favorite (returned when WithFavoriteStatus = 1)
Boolean
crc64
CRC64-ECMA182 check value of the file
String
versionId
version number (returned only for non-directory or non-album)
String
metaData
file metadata information (returned only for non-directory or non-album)
String
previewByDoc
whether preview via wps is supported (returned only for non-directory or non-album)
Boolean
previewByCI
whether preview via Wanxiang is supported (returned only for non-directory or non-album)
Boolean
previewAsIcon
whether the preview image can be used as an icon (returned only for non-directory or non-album)
Boolean
fileType
File type: Excel, PowerPoint (returned only for non-directory or non-album)
String
labels
Simplified file tag list, different from tagList, is actually designated when uploading or modifying files.
Array
category
Customized file category
Int
linkTo
The inode of the file the symbolic link points to, returned when the file is a symbolic link.
String

Error Codes

This request operation has no special error messages. For common error messages, see Error Codes.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback