includeHtml doesn't do its job

105 Views Asked by At

So I'm using https://www.npmjs.com/package/plagiarism-checker/v/3.0.1 to interact with Copyleaks' API and it's working great, except for the fact that setting CopyleaksFileSubmissionModel.includeHtml to true doesn't make it send the HTML on the completion webhook.

what my submit method looks like

can't add link to pastebin without a code block

req.body.json

report on Copyleaks website

Clicking on one of the results on the Copyleaks website does present me with the JSON containing the HTML and text for the scan.

So am I missing something or does includeHtml not work?

1

There are 1 best solutions below

0
On

except for the fact that setting CopyleaksFileSubmissionModel.includeHtml to true doesn't make it send the HTML on the completion webhook.

It might be misunderstanding of the scan cycle. The "Completion webhook" doesn't hold information about the HTML version of the content.

The HTML version of the submitted file can be downloaded by you on the Export method. Take a look on the crawledVersion parameter:

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

After exporting the crawledVersion JSON to your servers, you will find there the HTML presentation of your submitted file.