BOOK A DEMO
LOGIN
Homekeyboard_arrow_rightDocumentationkeyboard_arrow_rightVersion 3keyboard_arrow_rightPlagiarism Checkkeyboard_arrow_rightDownloadskeyboard_arrow_rightExport
POST

/v3/downloads/{scanId}/export/{exportId}

One of the most common patterns, when integrating with our services, is to submit a scan and download the full results as soon as the scan is completed. When the scan is completed, Copyleaks triggers a ‘Completed’ webhook to inform that the scan has been completed. At this point, you will have all the needed information (i.e. the ‘result ids’) to download and present the reports on your side. Since you may have large number of documents to download (the results, crawled version of the text and the pdf-report), you may need to send many HTTP REST calls to execute to export the data from our services.

The ‘Export’ method makes this process easier by specifying the content you would like to export in a single call and we will copy all the data according to your request. Then, we will fire an ‘export-completed; webhook with the export results summary.

If you are using a distributed cloud storage system (like AWS buckets, Google buckets or Azure Storage), we are able to export the data directly to your storage without the involvement of your servers. In order to do so, create a Signed URL for each data item that you would like to export. By specifying the request method (verb) and optionally added headers, the writing to this storage will be triggered, as per your definition.

lock You need to login with a user and api key in order to access this method.
Add this HTTP header to your request:
Authorization: Bearer <Your-Login-Token>
Not sure how to generate your login token? Read here .

Request

URL Parameters

Name
Description
scanIdREQUIRED
The scan ID of the specific scan to export.
String
Length: 3-36 characters.

Allowed characters are [a-z0-9] and the following symbols: [email protected]$^&-+%=_(){}<>';:/.",~`|

learn more about the criteria for creating a Scan ID .

exportIdREQUIRED
A new Id for the export process.
String
Length: 3-36 characters.

Allowed characters are [a-z0-9] and the following symbols: [email protected]$^&-+%=_(){}<>';:/.",~`|

Body Parameters

Name
Description
completionWebhookREQUIRED
This webhook event is triggered once the export is completed.
String (URI)
completionWebhookHeaders
Adds headers to the webhook.
Array of String Arrays
Example:
[
  [
    "header-key",
    "header-value"
  ],
  ...
]
maxRetries
How many retries to send before giving up. Using high value (12) may lead to a longer time until the completionWebhook being executed. A low value (1) may lead to errors while your service is temporary having problems.
Unsigned int
Range: 1-12
Default: 3
developerPayload
Add a custom developer payload that will then be provided on the Export-Completed webhook .
String
Max length: 512
results
An array of results to be exported.

Learn more about Result Webhook .

Array
Max length: 1000 items
results.idREQUIRED
Result identification to be downloaded. You get these identifications from the completed webhook .
String
results.endpointREQUIRED
The HTTP url to upload the data.
String (Uri)
results.verbREQUIRED
The HTTP verb (also called "HTTP Methods") to upload the data to your specified endpoint .
String
Example: POST
results.headers
List of headers to be submitted with the upload request. You may use this field to provide additional request headers, such as "Authorization" header.
Jagged Array (String)
Example:[["header-key1", "header-value1"], ["header-key2", "header-value2"]]
pdfReport
Download the PDF report. Allowed only when `properties.pdf.create` was set to true on the scan submittion.
Object
pdfReport.endpointREQUIRED
The HTTP url to upload the data.
String (Uri)
pdfReport.verbREQUIRED
The HTTP verb (also called "HTTP Methods") to upload the data to your specified endpoint .
String
Example: POST
pdfReport.headers
List of headers to be submitted with the upload request. You may use this field to provide additional request headers, such as "Authorization" header.
Jagged Array (String)
Example:[["header-key1", "header-value1"], ["header-key2", "header-value2"]]
crawledVersion
Download the crawled version of the submitted text.

Learn more about Crawled-Version Webhook .

Object
crawledVersion.endpointREQUIRED
The HTTP url to upload the data.
String (Uri)
crawledVersion.verbREQUIRED
The HTTP verb (also called "HTTP Methods") to upload the data to your specified endpoint .
String
Example: POST
crawledVersion.headers
List of headers to be submitted with the upload request. You may use this field to provide additional request headers, such as "Authorization" header.
Jagged Array (String)
Example:[["header-key1", "header-value1"], ["header-key2", "header-value2"]]

Request Example

RAW
cURL
Python
C#
Node.js
PHP
POST
https://api.copyleaks.com/v3/downloads/scan-id/export/export-id
Headers
Body
results:
0:
id: "my-result-id"
verb: "POST"
headers:
0:
0: "header-key"
1: "header-value"
endpoint: "https://yourserver.com/export/export-id/results/my-result-id"
pdfReport:
verb: "POST"
headers:
0:
0: "header-key"
1: "header-value"
endpoint: "https://yourserver.com/export/export-id/pdf-report"
crawledVersion:
verb: "POST"
headers:
0:
0: "header-key"
1: "header-value"
endpoint: "https://yourserver.com/export/export-id/crawled-version"
completionWebhook: "https://yourserver.com/export/export-id/completed"
maxRetries: 3

Response

Codes

Status Code
Description
Example
204
The command was executed. The export started.
400
Bad request. One or more details in your request is wrong.
401
Authorization has been denied for this request
404
The scan id that was specified doesn't exist.
409
Conflict. An export task with the same Id already exists in the system.

Other resources:

  • Performance Considerations Important! - How to improve your scan performance.
  • Exponential Backoff - Algorithm that helps applications define a retry strategy for consuming a network service.
  • Present the Report on Your Site - have a complete white-labeled report, and present it on your domain.
stack-overflow_icon.png

Do you have a technical question?

Use stackoverflow.com to get help from our development team and other Copyleaks users.

Ask a Question

PRODUCTS

Scans
Pricing
Copyleaks.com

RESOURCES

Documentation
Plagiarism Report
Help Center
System Status
Security

ABOUT

About us
Careers
Terms of Use
Privacy Policy
Sitemap

Copyleaks, Inc.

700 Canal St.
Stamford, CT 06902 USA

[email protected]

Copyleaks, Inc. All rights reserved. Use of this website signifies your agreement to the Terms of Use.

Copy