Add Flow's Document
Adds a document for a flow with the specified ID.
Request
HTTP Request
Permissions
Path parameters
Parameter | Type | Description |
---|---|---|
id | Stringrequired |
The ID of a flow for which a document should be added. |
Request body
The request body is empty.
Response
Work in Progress
This topic is a work in progress and may be incomplete.
Examples
Adding a link to a document
Below is an example of a request body representing a link to a document:
Provided the content is saved in a file named body.json
(required), a request can be done like this:
const request = require("request");
const fs = require("fs");
let login = <your_login>
let password = <your_password>
let saymon_hostname = <your_saymon_hostname>
let flow_id = <your_flow_id>
let url = "https://" + saymon_hostname + "/node/api/flows/" +
flow_id + "/docs";
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
let body = JSON.parse(fs.readFileSync("/path/to/body.json"));
let options = {
method: "POST",
url: url,
headers: {
Authorization: auth
},
json : body
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
});
import requests
import json
login = <your_login>
password = <your_password>
saymon_hostname = <your_saymon_hostname>
flow_id = <your_flow_id>
url = "https://" + saymon_hostname + "/node/api/flows/" + \
flow_id + "/docs"
with open("/path/to/body.json", "r") as f:
body = json.load(f)
response = requests.request("POST", url, json=body, auth=(login, password))
print(response.text)
Uploading a document
const request = require("request");
const fs = require("fs");
let login = <your_login>
let password = <your_password>
let saymon_hostname = <your_saymon_hostname>
let flow_id = <your_flow_id>
let url = "https://" + saymon_hostname + "/node/api/flows/" +
flow_id + "/docs";
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
let options = {
method: "POST",
url: url,
headers: {
Authorization: auth
},
formData: {
file: fs.createReadStream("/path/to/Dataflow.pdf"),
filetype: "pdf",
filename: "Dataflow.pdf"
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
import requests
import json
login = <your_login>
password = <your_password>
saymon_hostname = <your_saymon_hostname>
flow_id = <your_flow_id>
url = "https://" + saymon_hostname + "/node/api/flows/" + \
flow_id + "/docs";
files = {
"file": (
"Dataflow.pdf",
open("/path/to/Dataflow.pdf", "rb"),
"application/pdf"
)
}
response = requests.request("POST", url, files=files, auth=(login, password))
print(response.text)