Get formatted text markup
Changed onReturn stored formatted markup for a checked formatted text, including rendered HTML, the parsed map JSON, and the plain text used for the report.
The markup is a container div holding one div per rendered page, carrying the page number in data-page-no, followed by a style element with the CSS those pages need. pages reports how many pages the whole document has.
Without from and to the whole stored document is returned in html. With them the response carries parts instead of html: one entry per returned element, in document order, so a long document can be loaded page by page. from and to must be sent together, and css decides whether the CSS block is appended to a range.
A response is cached server side for 5 minutes, keyed by the text and the exact from, to and css it was asked with, or by the text alone for the whole document, so paging back and forth through a document or reopening one does not re-read and re-parse it every time. The access check runs before the cache is consulted. A whole document over 10 MB is not cached.
A 200 carries an ETag and Cache-Control: no-cache, private. Sending that value back in If-None-Match is answered with an empty 304 when the stored document is unchanged. The access check runs first here too.
The text must exist, must not be deleted, must be readable by the authenticated user, and must have formatted report assets available. Non-formatted texts and missing markup/map/plain-text assets return a validation error.
Request
- Base URLhttps://plagiarismcheck.org
- AuthAPI key in header X-API-TOKEN
Path parameters
Numeric ID of a text check or AI check, depending on the endpoint.
Query parameters
First logical markup page to return, 1-based and inclusive (same as map.dom.page_number). Must be sent together with to; sending one without the other is a validation error. When both are omitted the whole document is returned.
Last logical markup page to return, inclusive (same as map.dom.page_number). Must be sent together with from and cannot be lower than it. A range that starts past the last page returns an empty parts list rather than an error.
Append the CSS block to a page range. Only read together with from and to, and defaults to true, as does a value that is not a boolean. Send 0 when the styles are already loaded on the client.
Response
The request succeeded and returned stored formatted markup assets. html carries the whole document, parts the elements of a requested page range; exactly one of the two is present.
Example response
{
"success": true,
"data": {
"pages": 4,
"html": "<div><div class=\"pf\" data-page-no=\"1\">Example text</div></div><style>.ff1 { font-family: ff1; }</style>",
"parts": [
{
"type": "page",
"index": 2,
"html": "<div class=\"pf\" data-page-no=\"2\">Example text</div>",
"page_start_node_index": 3757
}
],
"map": [
{
"dom": {
"xpath": "//div/div[@class=\"pf w0 h0\"]/div[@class=\"pc pc1 w0 h0\"]/div[@class=\"c x0 y1 w1 h1\"]/div[@class=\"t m0 x1 h2 y2 ff1 fs0 fc0 sc0 ls0 ws0\"]",
"page_number": 1,
"page": "pf w0 h0",
"inner": "pc pc1 w0 h0",
"row": "t m0 x1 h2 y2 ff1 fs0 fc0 sc0 ls0 ws0",
"container": "c x0 y1 w1 h1"
},
"range": [
0,
25
]
}
],
"text": "Example text"
}
}Changes
- info
added the optional property
///to the response with the status
- info
- info
added the non-success response with the status
- info