API
檢查檔案
把檔案和 Business 或 Enterprise 工作區的有效標記比對。
POST/api/v1/detect
在這把金鑰的工作區檢查檔案。本文是 multipart/form-data。
驗證
Authorization: Bearer mf_…請送出這一行標頭。沒有工作階段 cookie。curl 與其他伺服器用戶端可以。其他頁面的瀏覽器會被拒絕。
參數
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
| file | file | 是 | 要檢查的檔案。相符只在這把金鑰的工作區尋找。在其他工作區標記的檔案不會被辨出。有效的 Business 或 Enterprise 工作區也可以檢查影片檔。單幀的螢幕截圖會當成圖片檢查。 |
請求
curl -X POST https://markedfile.com/api/v1/detect \
-H "Authorization: Bearer mf_…" \
-F "file=@leaked.pdf"回應
{
"id": "northwind",
"confidence": 0.95,
"layers": [
{
"name": "Metadata",
"hit": true,
"detail": "Authenticated metadata matched this workspace",
"screenshot": "No",
"crop": "No",
"reencode": "No"
}
],
"notes": [
"Confidence is 99% for an exact file or when an authenticated mark agrees with another mark. A visual match alone stays lower, and weak bit agreement stays far from a high score."
]
}id 是標記副本時指定的識別碼。這個工作區沒有相符時是 null。檔案完全相同,或已驗證的標記與另一個標記一致時,confidence 是 99%。只有視覺相符會較低。layers 顯示各層,相符層的 hit 是 true。notes 說明這次檢查做了什麼。已刪除的檔案不會被辨出。
錯誤
JSON 回應裡 error 欄位的文字是英文。
| 狀態 | 說明 |
|---|---|
| 400 | 檔案是空的。 |
| 401 | 金鑰不存在、已撤銷,或無法辨識。JSON 回應含有 "code": "api-key"。 |
| 403 | 工作區沒有有效的 Business 或 Enterprise 方案(回應含有 "code": "enterprise")。或者瀏覽器送出了 cross-site 或 same-site 請求。 |
| 413 | 檔案超過方案的上傳上限,或 PDF 頁數多於方案上限。 |
| 422 | 無法處理檔案。 |
| 429 | 這把金鑰在目前這一分鐘內做了超過 80 次偵測。 |
呼叫上限
這把金鑰每分鐘 80 次。計數存在產品資料庫,重新啟動後仍在。