跳到內容

檔案庫

檔案庫統一展示目前帳號可存取的原始檔案、任務結果和應用程式檔案。每一項使用穩定的 file_id,並回傳呼叫方目前可執行的能力。

翻譯輸入文檔另提供 /api/v1/documents 列表、詳情、更新和刪除端點。document_id 用於建立處理任務;file_id 用於統一檔案庫權限與下載。請勿假設兩種 ID 可互換。

GET /api/v1/storage/files?offset=0&limit=50
GET /api/v1/storage/files/{file_id}

清單回應:

{
"items": [
{
"id": "x7m4q2k9n6c1v8pa",
"name": "report.docx",
"content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"size_bytes": 45678,
"status": "ready",
"publication_status": "draft",
"origin": {
"product_code": "omnidoc-main",
"display_name": "OmniDoc"
},
"capabilities": {
"can_view": true,
"can_download": true,
"can_update": true,
"can_delete": true,
"can_share": true
},
"created_at": "2026-10-01T12:00:00Z",
"updated_at": "2026-10-01T12:00:00Z"
}
],
"has_more": true,
"next_offset": 50
}

翻頁時將 next_offset 設為下一次請求的 offset,當 has_more 為 false 時結束。

始終以每個條目的 capabilities 判斷是否可下載、分享或授權給應用程式,不根據來源欄位自行推斷權限。

GET /api/v1/storage/files/{file_id}/content
POST /api/v1/storage/files/{file_id}/download-ticket

/content 會 302 跳轉到短時有效的下載位址;跟隨跳轉時不要攜帶 API Key,建議先申請 download-ticket。下載位址過期後重新申請,請勿長期保存。

GET /api/v1/storage/files/{file_id}/permissions
POST /api/v1/storage/files/{file_id}/permissions
DELETE /api/v1/storage/files/{file_id}/permissions/{grant_id}
GET /api/v1/storage/files/{file_id}/links
POST /api/v1/storage/files/{file_id}/links
DELETE /api/v1/storage/files/{file_id}/links/{link_id}

權限變更與公開連結是不同能力。建立連結時明確設定受眾、下載權限、過期時間和可選下載次數;不再需要時立即撤銷。

GET /api/v1/workspace/files
GET /api/v1/workspace/entries
GET /api/v1/workspace/apps

工作區介面適合構建檔案中心;/storage/files 適合圍繞單個檔案執行權限與下載操作。