为什么我在导出 API 调用时收到来自 CopyLeaks 的"conflict" HTTP 409 响应?



我得到一个HTTP 409"冲突;在处理CopyLeaks的"响应"时;"完成";发送导出请求时使用webhook。我今天每次提交测试扫描时都会收到它,但几天前我上次测试代码时没有收到。每次新扫描我都会得到它。回复没有正文,也没有更多信息。知道是什么原因导致的吗?如何解决?

以下是一些调试信息:扫描API请求主体:

{
"base64": "IjEuIElzIGl0IG9rIHRvIGhhdmUgYSBkYXJrIHJvb20gZHVyaW5nIHRoZSBleGFtPw0KDQoobWluaW11bSBvbmUgcGFyYWdyYXBoIHJlc3BvbnNlIC0gIDUgc2VudGVuY2VzKSI6Ck9rIEknbSBnb2luZyB0byBzdGFydCB3cml0aW5nIG91dCBteSBhbnN3ZXJzLi4uIGxhbGFsYWxhbGFsYWxhLiBNWSBBTlNXRVJTIEFSRSBTVElMTCBIRVJFISBJIExPVkUgUEFDUklNCgoiMS4gYikgV2hlcmUgaXMgdGhlIG1vc3QgaW1wb3J0YW50IHBsYWNlIHRvIHNob3cgaW4gdGhlIHJvb20gc2Nhbj8NCihtaW5pbXVtIG9uZSBwYXJhZ3JhcGggcmVzcG9uc2UgLSAgNSBzZW50ZW5jZXMpIjoKU28gZmFzdC4gTm90aGluZyBpcyBzYXZlZCB5ZXQsIGl0IG9ubHkgZ2V0cyBzYXZlZCBldmVyeSBtaW51dGUuIEl0IGNvdWxkIGJlIGxvbmdlciwgaWYgeW91IHdhbnQuIE9yIHNob3J0ZXIuIEFsbGxsbGxsbCBnb29kLiBKdXN0IHdhdGNoIHRoZSByaWdodC1oYW5kIGNvcm5lciBvZiB0aGUgc2NyZWVuLiBNYWdpYyB3aWxsIGhhcHBlbi4KCiIyLiBJcyBpdCBvayB0byByZWFkIGZyb20geW91ciBwaG9uZSBkdXJpbmcgdGhlIGV4YW0/IA0KKG1pbmltdW0gMSBzZW50ZW5jZSBhbnN3ZXIuKSI6ClNvIG1hZ2ljLiB3YWl0IGZvciBpdC4gT2sgSSdsbCBmaW5pc2ggdXAuIFdhaXQgZm9yIHRoZSBhdXRvc2F2ZSBhZ2FpbiwganVzdCB0byBzaG93IGl0cyBzdGlsbCB3b3JraW5nLi4uLiBldmVudHVhbGx5Li4uIEkgdGhpbmsgaW4gYSBmZXcgc2Vjb25kcy4uLiBtYXliZS4uLi4NCkkgc3VwcG9zZSB5b3UgY2FuIGZhc3QgZm9yd2FyZCB0aGlzIGlmIHlvdSB3YW50LiBOb3QgbWUuIEknbSBzdHVjayBpbiBodW1hbiB0aW1lLiBPSCENCk9rIG5vdyBJJ2xsIHN1Ym1pdC4KCg==",
"filename": "087.txt",
"properties": {
"developerPayload": "Submitted by Mike",
"exclude": {
"quotes": true,
"titles": true
},
"sandbox": true,
"webhooks": {
"status": "https://dev.earlychildhoodeducator.com/copyleaks/webhook/completed/087"
}
}
}

完整的webhook接收正文:

{"scannedDocument":{"scanId":"087","totalWords":158,"totalExcluded":56,"credits":0,"expectedCredits":1,"creationTime":"2021-07-21T03:48:41.013271Z","metadata":{"filename":"uploaded.txt"}},"results":{"score":{"identicalWords":1,"minorChangedWords":0,"relatedMeaningWords":0,"aggregatedScore":1.0},"internet":[{"url":"http://example.com/","id":"2a1b402420","title":"Example Domain","introduction":"Example Domain This domain is for use in illustrative examples in documents. You may use this domain in literature without ...","matchedWords":1,"metadata":{"finalUrl":"http://example.com/","filename":"source"}}],"database":[],"batch":[],"repositories":[]},"notifications":{"alerts":[]},"status":0,"developerPayload":"Submitted by Mike"}

出口API主体:

{
"completionWebhook": "https://dev.earlychildhoodeducator.com/copyleaks/webhook/exported/87",
"crawledVersion": {
"endpoint": "https://dev.earlychildhoodeducator.com/copyleaks/webhook/crawled/87",
"headers": [
[
"HTTP_PRECI",
"PRECI uOaDeRrRVhRPhQhJgHNK"
]
],
"verb": "POST"
},
"results": [
{
"endpoint": "https://dev.earlychildhoodeducator.com/copyleaks/webhook/result/87/2a1b402420",
"headers": [
[
"HTTP_PRECI",
"PRECI uOaDeRrRVhRPhQhJgHNK"
]
],
"id": "2a1b402420",
"verb": "POST"
}
]
}

导出API响应:

状态:";冲突;

标题:

{'Date': 'Wed, 21 Jul 2021 03:49:26 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=2592000; includeSubDomains', 'CF-Cache-Status': 'DYNAMIC', 'Expect-CT': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'Report-To': '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=WFnYOPnNkcR4D%2F1%2BCbmHopFZw9ZtYMtUAVjA8Vx3c8OLYZakWpL76ysOKJ03Yd%2Fo6eNUaO35T%2B0k2lZxaUB9g6VYnmur9JrAnhL0G6%2FeceKE%2BTXCJBeMdEQDgGnEOrHRvTON"}],"group":"cf-nel","max_age":604800}', 'NEL': '{"report_to":"cf-nel","max_age":604800}

并且没有响应机构。

每个导出任务都有其唯一的任务id。使用请求的id创建作业后,就无法使用相同的id创建另一个导出作业。

话虽如此,如果您遇到错误409,我假设您正在尝试导出具有相同作业id的多个任务。

为了提交唯一的导出Id,您必须将URI更改为以下形式:

https://api.copyleaks.com/v3/downloads/scanId/export/UNIQUE_JOB_ID

并为您创建的每个新导出作业设置一个UNIQUE_JOB_ID

相关内容

  • 没有找到相关文章

最新更新