Smart Folder
Smart Folder API 允許您列出、建立、更新、刪除智慧型資料夾,並查詢符合條件的項目。
端點概覽
GET
/api/v2/smartFolder/get
列出智慧型資料夾
POST
/api/v2/smartFolder/get
列出智慧型資料夾(請求主體)
POST
/api/v2/smartFolder/create
建立智慧型資料夾
POST
/api/v2/smartFolder/update
更新智慧型資料夾
POST
/api/v2/smartFolder/remove
刪除智慧型資料夾
GET
/api/v2/smartFolder/getItems
取得符合條件的項目
POST
/api/v2/smartFolder/getItems
取得符合條件的項目(請求主體)
GET
/api/v2/smartFolder/getRules
取得可用規則 schema
GET /api/v2/smartFolder/get
列出所有智慧型資料夾,或以 ID 篩選。
查詢參數
idstring(可選)— 以 ID 回傳單一智慧型資料夾idsstring(可選)— 以逗號分隔的智慧型資料夾 ID
回應
範例
POST /api/v2/smartFolder/get
與 GET 相同,但接受 JSON 主體中的篩選參數。
請求主體
idstring(可選)— 智慧型資料夾 IDidsstring[](可選)— 智慧型資料夾 ID 陣列
範例
POST /api/v2/smartFolder/create
建立新的智慧型資料夾。
請求主體
namestring(必填)— 智慧型資料夾名稱conditionsObject[](必填)— 篩選條件(格式請參考下方 conditions 格式說明)descriptionstring(可選)— 說明iconstring(可選)— 圖示iconColorstring(可選)— 圖示顏色。可選值:red、orange、yellow、green、aqua、blue、purple、pinkparentstring(可選)— 父智慧型資料夾 ID。若省略則建立在根層級。
回應
回傳新建立的智慧型資料夾物件。
範例
POST /api/v2/smartFolder/update
更新現有智慧型資料夾的中繼資料。只有您包含的欄位會被修改。
請求主體
idstring(必填)— 要更新的智慧型資料夾 ID
可修改的欄位:
namestring(可選)— 新名稱conditionsObject[](可選)— 新篩選條件descriptionstring(可選)— 新說明iconstring(可選)— 新圖示iconColorstring(可選)— 新圖示顏色
回應
回傳更新後的智慧型資料夾物件。
範例
POST /api/v2/smartFolder/remove
刪除智慧型資料夾。同時會刪除其所有子智慧型資料夾。
請求主體
idstring(必填)— 要刪除的智慧型資料夾 ID
回應
範例
GET /api/v2/smartFolder/getItems
取得符合智慧型資料夾篩選條件的項目。
查詢參數
smartFolderIdstring(必填)— 智慧型資料夾 IDorderBystring(可選)— 排序欄位fieldsstring(可選)— 以逗號分隔的回傳欄位列表
回應
範例
POST /api/v2/smartFolder/getItems
與 GET 相同,但接受 JSON 主體中的參數。
請求主體
smartFolderIdstring(必填)— 智慧型資料夾 IDorderBystring(可選)— 排序欄位fieldsstring[](可選)— 要回傳的欄位
範例
GET /api/v2/smartFolder/getRules
取得可用的篩選規則 schema。回傳每個 property 支援的 methods、valueType、options 等資訊,讓呼叫者可以動態建構合法的 conditions。
回應
範例
Conditions 格式說明
智慧型資料夾的 conditions 是一個條件群組陣列,每個群組包含多條規則:
條件群組屬性
rules
Object[]
規則陣列
match
string
規則間的邏輯運算。"AND":全部符合;"OR":任一符合
boolean
string
群組的包含/排除邏輯。"TRUE"(包含,預設)或 "FALSE"(排除)
規則屬性
property
string
篩選屬性(如 name、width、type)
method
string
篩選方法(如 contain、>、equal)
value
any
篩選值(格式依屬性和方法而定)
SmartFolder 屬性
API 回傳的智慧型資料夾包含以下屬性:
id
string
唯一智慧型資料夾 ID
name
string
名稱
conditions
Object[]
篩選條件
description
string
說明
icon
string
圖示
iconColor
string
圖示顏色
children
Object[]
子智慧型資料夾
modificationTime
integer
最後修改時間戳記
imageCount
integer
符合條件的項目數量
Last updated