Product Overview
Feature Description
Product Strengths
Use Cases
Basic Concept
try {let result = await SMHDirectoryApis.listDirectory({libraryId:"libraryId",spaceId:"spaceId",dirPath:'dir',limit:'10',orderBy:SMHFileListOrderBy.name,orderByType:SMHOrderByType.asc,withFavoriteStatus:true,withInode:true});}catch (e) {// Exception handling}
Request parameters. | Description | Type | Required or Not |
libraryId | Media Library ID, obtained after creating a media library through 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 hyphen (`-`). If the media library is in multi-tenant mode, you must specify this parameter. See create tenant space | String | No |
dirPath | Directory path or album name. For multi-level directory, use a slash (/) to separate, such as foo/bar. For root directory, leave this parameter blank. | String | No |
marker | Identification for sequential list pagination cannot be used with page and page_size parameters simultaneously | String | No |
limit | Limit for locally listed items in sequential pagination cannot be used with page and page_size parameters simultaneously | String | No |
page | pagination code, default first page, optional parameter, cannot be used with marker and limit parameters simultaneously | Number | No |
pageSize | page size, default 20, optional parameter, cannot be used with marker and limit parameters simultaneously | Number | No |
orderBy | sorting field, sort by name as name, sort by modification time as modificationTime, sort by file size as size, sort by creation time as creationTime | SMHFileListOrderBy | No |
orderByType | sorting method, ascending as asc, descending as desc | SMHOrderByType | No |
directoryFilter | Filtering method, return all if not specified, onlyDir for folders only, onlyFile for files only | SMHDirectoryFilter | No |
sortType | Sorting method. If not specified, files and folders are sorted separately, with folders returned first followed by files. union sorts files and folders together. | String | No |
withFavoriteStatus | Whether to return favorite status | Bool | No |
withInode | Whether to return inode, the file directory ID | Bool | No |
try{let result = await SMHDirectoryApis.createDirectory({libraryId:"libraryId",spaceId:"spaceId",dirPath: "dir",conflictResolutionStrategy: SMHConflictResolutionStrategy.rename,});}catch(e){// Exception handling}
Request parameters. | Description | Type | Required or Not |
libraryId | Media Library ID, obtained after creating a media library through 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 hyphen (`-`). If the media library is in multi-tenant mode, you must specify this parameter. See create tenant space | String | No |
dirPath | Directory path or album name. For multi-level directory, use a slash (/) to separate, such as foo/bar. For root directory, leave this parameter blank. | String | Yes |
conflictResolutionStrategy | Handling method when last-level directory conflicts Returns HTTP 409 Conflict and SameNameDirectoryOrFileExists error code when conflicts with rename the last level directory if conflicts with ask by default | SMHConflictResolutionStrategy | No |
withInode | Whether to return inode, the file directory ID | Bool | No |
try{let result = await SMHDirectoryApis.deleteDirectory({libraryId:"libraryId",spaceId:"spaceId",dirPath:'path'});}catch(e){// Exception handling}
Request parameters. | Description | Type | Required or Not |
libraryId | Media Library ID, obtained after creating a media library through 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 hyphen (`-`). If the media library is in multi-tenant mode, you must specify this parameter. See create tenant space | String | No |
dirPath | Directory path or album name. For multi-level directories, use a slash (/) to separate, such as foo/bar. | String | Yes |
permanent | When the media library enables the Recycle Bin, this parameter specifies whether to move the file to the Recycle Bin or permanently delete it. true: permanently delete, false: move to Recycle Bin, default to false. | Bool | No |
try {let result = await SMHDirectoryApis.copyDirectory({libraryId:"libraryId",spaceId:"spaceId",dirPath: "path",copyFrom: "from"})} catch (e) {// Exception handling}
Request parameters. | Description | Type | Required or Not |
libraryId | Media Library ID, obtained after creating a media library through 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 hyphen (`-`). If the media library is in multi-tenant mode, you must specify this parameter. See create tenant space | String | No |
dirPath | Directory path or album name. For multi-level directories, use a slash (/) to separate, such as foo/bar. | String | Yes |
copyFrom | Source directory or album path to be copied | String | Yes |
conflictResolutionStrategy | Handling method when last-level directory conflicts Returns HTTP 409 Conflict and SameNameDirectoryOrFileExists error code when conflicts with rename the last level directory if conflicts with ask by default | SMHConflictResolutionStrategy | No |
try {let result = await SMHDirectoryApis.moveDirectory({libraryId:"libraryId",spaceId:"spaceId",dirPath: "path",from: "from"})} catch (e) {// Exception handling}
Request parameters. | Description | Type | Required or Not |
libraryId | Media Library ID, obtained after creating a media library through 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 hyphen (`-`). If the media library is in multi-tenant mode, you must specify this parameter. See create tenant space | String | No |
dirPath | Directory path or album name. For multi-level directories, use a slash (/) to separate, such as foo/bar. | String | Yes |
from | Source directory or album path to be renamed or moved | String | Yes |
conflictResolutionStrategy | Handling method when last-level directory conflicts Returns HTTP 409 Conflict and SameNameDirectoryOrFileExists error code when conflicts with rename the last level directory if conflicts with ask by default | SMHConflictResolutionStrategy | No |
try{let result = await SMHDirectoryApis.updateLabels({libraryId:"libraryId",spaceId:"spaceId",dirPath:"path",labels:["18","age"]});}catch(e){// Exception handling}
Request parameters. | Description | Type | Required or Not |
libraryId | Media Library ID, obtained after creating a media library through 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 hyphen (`-`). If the media library is in multi-tenant mode, you must specify this parameter. See create tenant space | String | No |
dirPath | Directory path or album name. For multi-level directories, use a slash (/) to separate, such as foo/bar. | String | Yes |
labels | File Tag List | String array | No |
try {let result = await SMHDirectoryApis.additionalInfo({libraryId:"libraryId",spaceId:"spaceId",dirPath: "test",objectsKeys: ["key1"]})} catch (e) {// Exception handling}
Request parameters. | Description | Type | Required or Not |
libraryId | Media Library ID, obtained after creating a media library through 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 hyphen (`-`). If the media library is in multi-tenant mode, you must specify this parameter. See create tenant space | String | No |
dirPath | Directory or file path or album name. For multi-level directories, use a slash (/) to separate, such as foo/bar. | String | Yes |
objectsKeys | Each element should be the name of a file or directory under DirPath. | String array | Yes |
try{let result = await SMHDirectoryApis.directoryDetail({libraryId:"libraryId",spaceId:"spaceId",dirPath:"path",withInode:true,withFavoriteStatus:true});}catch(e){// Exception handling}
Request parameters. | Description | Type | Required or Not |
libraryId | Media Library ID, obtained after creating a media library through 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 hyphen (`-`). If the media library is in multi-tenant mode, you must specify this parameter. See create tenant space | String | No |
dirPath | Directory path or album name. For multi-level directories, use a slash (/) to separate, such as foo/bar. | String | Yes |
withInode | Whether to return inode, the file directory ID | Bool | No |
try{let result = await SMHDirectoryApis.headDirectory({libraryId:"libraryId",spaceId:"spaceId",dirPath:"path"});}catch(e){// Exception handling}
Request parameters. | Description | Type | Required or Not |
libraryId | Media Library ID, obtained after creating a media library through 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 hyphen (`-`). If the media library is in multi-tenant mode, you must specify this parameter. See create tenant space | String | No |
dirPath | Directory path or album name. For multi-level directories, use a slash (/) to separate, such as foo/bar. | String | Yes |
try{let result = await SMHDirectoryApis.getAlbumCoverUrl({libraryId:"libraryId",spaceId:"spaceId",albumName:"albumName",size:"100"});}catch(e){// Exception handling}
Request parameters. | Description | Type | Required or Not |
libraryId | Media Library ID, obtained after creating a media library through 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 hyphen (`-`). If the media library is in multi-tenant mode, you must specify this parameter. See create tenant space | String | No |
albumName | Album name. This parameter must be specified for an album-based media library and cannot be specified for a non-album media library. | String | No |
size | Scale size. If this parameter is specified, prioritize intelligent face recognition zoom cropping to {Size}px × {Size}px. If no human face is detected, use centered zoom cropping to {Size}px × {Size}px. If the {Size} parameter is not specified, use the original image. | String | No |
フィードバック