To enable the Compliance API, see the setup guide.
Set up the Compliance API获取项目文档元数据
GET/v1/compliance/apps/projects/documents/{document_id}/metadata
返回项目文档的元数据,不包含内容正文。
使用同级的 GET /v1/compliance/apps/projects/documents/{document_id} 端点获取文档文本。此处的 md5 和 size_bytes 字段是基于该文本的 UTF-8 编码计算的,因此 DLP 使用方可以在不下载每个文档的情况下进行去重或哈希匹配。
Path parameters
Headers
Returns
获取项目文档元数据
cURL
curl https://api.anthropic.com/v1/compliance/apps/projects/documents/$DOCUMENT_ID/metadata \
-H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"Response 200
{
"id": "id",
"claude_project_id": "claude_project_id",
"created_at": "2019-12-27T18:11:19.117Z",
"filename": "filename",
"md5": "md5",
"mime_type": "text/plain",
"size_bytes": 0,
"user": {
"id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
"email_address": "jane.doe@example.com"
}
}Returns Examples
Response 200
{
"id": "id",
"claude_project_id": "claude_project_id",
"created_at": "2019-12-27T18:11:19.117Z",
"filename": "filename",
"md5": "md5",
"mime_type": "text/plain",
"size_bytes": 0,
"user": {
"id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
"email_address": "jane.doe@example.com"
}
}