Update Flow Property
Request
Path parameters
Parameter | Type | Description |
---|---|---|
flow_id |
String |
The ID of a flow whose property should be updated. |
prop_id |
String |
The ID of a property to be updated. |
Body parameters
Field | Type | Description |
---|---|---|
name |
String |
Property’s name. |
value |
String |
Property’s value. |
type_id |
Integer |
Property’s type ID |
Response
Unlike Update Link Property and Update Class Property, this request returns only updated properties alongside the information about the flow that the property is attached to (its ID in the owner_id
field and its type in the owner_type
field).
-
Updated Value
-
Updated Name and Value
Request Body:
{
"value": "Updated Property Value"
}
Response body:
{
"value": "Updated Property Value",
"owner_id": "62f2854e18baa649c1d25a58",
"owner_type": 3,
"id": "62f2856218baa649c1d25a5a"
}
Request Body:
{
"name": "Updated Property Name",
"value": "Updated Property Value"
}
Response body:
{
"name": "Updated Property Name",
"value": "Updated Property Value",
"owner_id": "62f2854e18baa649c1d25a58",
"owner_type": 3,
"id": "62f2856218baa649c1d25a5a"
}
Response can contain these fields:
Field | Type | Description |
---|---|---|
id |
String |
Property’s ID. |
name |
String |
Property’s name. |
value |
String |
Property’s value. |
type_id |
Integer |
Property’s type ID |
owner_id |
String |
The ID of the flow that the property is attached to. |
owner_type |
Integer |
The type of the entity that the property is attached to. For a flow, this value is |
Example
Request
-
Bash
-
JavaScript
-
NodeJS
-
Python
login=<...>
password=<...>
saymon_hostname=<...>
flow_id=<...>
prop_id=<...>
url=https://$saymon_hostname/node/api/flows/$flow_id/props/$prop_id
curl -X PATCH $url -u $login:$password \
-H "Content-Type: application/json" \
-d @- <<EOF
{
"value": "New Property Value"
}
EOF
let login = <...>
let password = <...>
let saymonHostname = <...>
let flowId = <...>
let properyId = <...>
let path = "/node/api/flows/" + flowId + "/props/" + properyId;
let auth = "Basic " + btoa(login + ":" + password);
let headers = new Headers();
headers.append("Content-Type", "application/json");
headers.append("Authorization", auth);
let data = JSON.stringify({
"value": "New Property Value"
});
let requestOptions = {
method: "PATCH",
headers: headers,
body: data
};
fetch(saymonHostname + path, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log("error", error));
const http = require("http");
let login = <...>
let password = <...>
let saymonHostname = <...>
let flowId = <...>
let propId = <...>
let path = "/node/api/flows/" + flowId + "/props/" + propId;
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
let options = {
"method": "PATCH",
"hostname": saymonHostname,
"headers": {
"Authorization": auth,
"Content-Type": "application/json"
},
"path": path
};
let req = http.request(options, function (res) {
let chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
let body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
let data = JSON.stringify({
"value": "New Property Value"
});
req.write(data);
req.end();
import requests
login = <...>
password = <...>
saymon_hostname = <...>
flow_id = <...>
property_id = <...>
url = "https://" + saymon_hostname + "/node/api/flows/" + \
flow_id + "/props/" + property_id
body = {
"value": "New Property Value"
}
response = requests.request("PATCH", url, json=body, auth=(login, password))
print(response.text)