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 次。计数存在产品数据库,重新启动后仍在。