Folder
Folder API 允許您列出、建立及管理 Eagle 資源庫中的資料夾。
Last updated
{
"status": "success",
"data": {
"data": [
{
"id": "LRK3AQGN7VCB1",
"name": "Design References",
"description": "UI/UX design references",
"children": [],
"modificationTime": 1700000000000,
"tags": [],
"iconColor": "blue",
"imageCount": 42
}
],
"total": 25,
"offset": 0,
"limit": 50
}
}// 列出所有資料夾(前 50 個)
await fetch("http://localhost:41595/api/v2/folder/get").then(r => r.json());
// 以 ID 取得單一資料夾
await fetch("http://localhost:41595/api/v2/folder/get?id=LRK3AQGN7VCB1").then(r => r.json());
// 取得最近使用的資料夾
await fetch("http://localhost:41595/api/v2/folder/get?isRecent=true").then(r => r.json());// 以多個 ID 取得資料夾
await fetch("http://localhost:41595/api/v2/folder/get", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
ids: ["FOLDER_ID_1", "FOLDER_ID_2"]
})
}).then(r => r.json());{
"status": "success",
"data": {
"id": "NEW_FOLDER_ID",
"name": "My New Folder",
"description": "",
"children": [],
"modificationTime": 1700000000000,
"tags": []
}
}// 建立根層級資料夾
await fetch("http://localhost:41595/api/v2/folder/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ name: "My New Folder" })
}).then(r => r.json());
// 建立子資料夾
await fetch("http://localhost:41595/api/v2/folder/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: "Subfolder",
description: "A subfolder for organizing",
parent: "PARENT_FOLDER_ID"
})
}).then(r => r.json());// 重新命名資料夾並設定圖示顏色
await fetch("http://localhost:41595/api/v2/folder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
name: "Renamed Folder",
iconColor: "green"
})
}).then(r => r.json());
// 將資料夾移至其他父資料夾
await fetch("http://localhost:41595/api/v2/folder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
parent: "NEW_PARENT_ID"
})
}).then(r => r.json());
// 將資料夾移至根層級
await fetch("http://localhost:41595/api/v2/folder/update", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
id: "LRK3AQGN7VCB1",
parent: null
})
}).then(r => r.json());