我已经使用提交文件方法在Copyleaks API平台上创建了一个新的扫描。使用此代码:
curl -XPUT -H 'Authorization: Bearer XXX' -H "Content-type: application/json" -d '{
"base64": "SGVsbG8gd29ybGQh",
"filename": "file.txt",
"properties": {
"webhooks": {
"status": "https://yoursite.com/webhook/{STATUS}/my-custom-id"
}
}
}' 'https://api.copyleaks.com/v3/businesses/submit/file/my-custom-id'
我得到了完成webhook,上面写着扫描成功完成。
如何下载工件:
- 我的文档的爬网版本
- PDF报告
- 结果
并将其存储在我的服务器上?
基于此说明页-导出文档。
这种方法的思想是允许Copyleaks服务器将所有扫描工件推送到客户服务器中。这就像一个PUSH消息,其中Copyleaks服务器是会话发起方。
如果你正在使用云存储(如Google Bucket、Azure Storage或其他(,你可以要求Copyleaks Export方法使用签名URL直接写入它们。
原始调用示例:
POST https://api.copyleaks.com/v3/downloads/scan-id/export/export-id
Authorization: Bearer XXX;
{
"results": [
{
"id": "my-result-id",
"verb": "POST",
"headers": [
["header-key", "header-value"]
],
"endpoint": "https://yourserver.com/export/export-id/results/my-result-id"
}
],
"pdfReport": {
"verb": "POST",
"headers": [
["header-key", "header-value"]
],
"endpoint": "https://yourserver.com/export/export-id/pdf-report"
},
"crawledVersion": {
"verb": "POST",
"headers": [
["header-key", "header-value"]
],
"endpoint": "https://yourserver.com/export/export-id/crawled-version"
},
"completionWebhook": "https://yourserver.com/export/export-id/completed",
"maxRetries": 3
}