BOOK A DEMO
LOGIN
Homekeyboard_arrow_rightDocumentationkeyboard_arrow_rightVersion 3keyboard_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
scanId REQUIRED
The scan ID of the specific scan to export.
String
Length: 3-36 characters.

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

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

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

Body Parameters

Name
Description
completionWebhook REQUIRED
This webhook event is triggered once the export is completed.
String (URI)
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 Legnth: 512
results
An array of results to be exported.
Array
Max Legnth: 498 items
results.id REQUIRED
Result identification to be downloaded. You get these identifications from the completed webhook.
String
results.endpoint REQUIRED
The HTTP url to upload the data.
String (Uri)
results.verb REQUIRED
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.endpoint REQUIRED
The HTTP url to upload the data.
String (Uri)
pdfReport.verb REQUIRED
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.
Object
crawledVersion.endpoint REQUIRED
The HTTP url to upload the data.
String (Uri)
crawledVersion.verb REQUIRED
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

cURL
RAW
Python
C#
Node.js
PHP
POST https://api.copyleaks.com/v3/downloads/scan-id/export/export-id

Content-Type: application/json;
Authorization: Bearer YOUR-LOGIN-TOKEN;

{
  "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
}
			

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 ConsiderationsImportant! - 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

Education
Businesses
Pricing
Copyleaks.com

RESOURCES

Help Center
Documentation
Plagiarism Report
System Status
Security

ABOUT

About us
Careers
Terms of Use
Privacy Policy
Sitemap

Copyleaks Technologies, LTD.

700 Canal St.
Stamford, CT 06902 USA

[email protected]

Copyleaks Technologies LTD. All rights reserved. Use of this website signifies your agreement to the Terms of Use.