Get Number Of Pages in Flow's Document

GET /node/api/flow/:id/docs/:doc_id/:format/pages

Returns the number of pages in a flow's document.

Request parameters

Path parameters

Parameter
Type
Description
doc_id
string
required
The ID of a document to be retrieved.
format
string
required
Either .pdf or .png. For the first option, the actual number of pages is returned. For the second one, the result is always equal to one.
id
string
required
The ID of a flow whose document should be processed.

Response description

Field
Type
Description
count
integer
required
The number of pages in the specified flow's document.

Examples

Request examples

Bash
JavaScript
NodeJS
Python
1
login=<...>
2
password=<...>
3
saymon_hostname=<...>
4
flow_id=<...>
5
document_id=<...>
6
format=png
7
url=https://$saymon_hostname/node/api/flows/$flow_id/docs/$document_id/$format/pages
8
9
curl -X GET $url -u $login:$password
Copied!
1
let login = <...>
2
let password = <...>
3
let saymonHostname = <...>
4
let flowId = <...>
5
let documentId = <...>
6
let format = "png";
7
let path = "/node/api/flows/" + flowId + "/docs/" +
8
documentId + "/" + format + "/pages";
9
let auth = "Basic " + btoa(login + ":" + password);
10
11
let headers = new Headers();
12
headers.append("Authorization", auth);
13
14
let requestOptions = {
15
method: "GET",
16
headers: headers
17
};
18
19
fetch(saymonHostname + path, requestOptions)
20
.then(response => response.text())
21
.then(result => console.log(result))
22
.catch(error => console.log("error", error));
Copied!
1
const http = require("http");
2
3
let login = <...>
4
let password = <...>
5
let saymonHostname = <...>
6
let flowId = <...>
7
let documentId = <...>
8
let format = "png";
9
let path = "/node/api/flows/" + flowId + "/docs/" +
10
documentId + "/" + format + "/pages";
11
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
12
13
let options = {
14
"method": "GET",
15
"hostname": saymonHostname,
16
"headers": {
17
"Authorization": auth
18
},
19
"path": path
20
};
21
22
let req = http.request(options, function (res) {
23
let chunks = [];
24
25
res.on("data", function (chunk) {
26
chunks.push(chunk);
27
});
28
29
res.on("end", function (chunk) {
30
let body = Buffer.concat(chunks);
31
console.log(body.toString());
32
});
33
34
res.on("error", function (error) {
35
console.error(error);
36
});
37
});
38
39
req.end();
Copied!
1
import requests
2
3
login = <...>
4
password = <...>
5
saymon_hostname = <...>
6
flow_id = <...>
7
document_id = <...>
8
_format = "png"
9
url = "https://" + saymon_hostname + "/node/api/flows/" + \
10
flow_id + "/docs/" + document_id + "/" + _format + "/pages"
11
12
response = requests.request("GET", url, auth=(login, password))
13
print(response.text)
Copied!

Response example

1
{
2
"count": 10
3
}
Copied!