Update Link Property

PATCH /node/api/links/:link_id/props/:prop_id

Updates a link property with data provided in a request body.
Permissions: linkPermissions & (manage-properties | manage-links). If a property is a service property, the manage-service-properties permission is required.

Request parameters

Path parameters

Parameter
Type
Description
link_id
string
required
The ID of a link whose property should be updated.
prop_id
string
required
The ID of a property to be updated.

Body parameters

...

Response description

...

Examples

Request examples

Bash
JavaScript
NodeJS
Python
1
login=<...>
2
password=<...>
3
saymon_hostname=<...>
4
link_id=<...>
5
prop_id=<...>
6
url=https://$saymon_hostname/node/api/links/$link_id/props/$prop_id
7
8
curl -X PATCH $url -u $login:$password \
9
-H "Content-Type: application/json" \
10
-d @- <<EOF
11
{
12
"value": "New Property Value"
13
}
14
EOF
Copied!
1
let login = <...>
2
let password = <...>
3
let saymonHostname = <...>
4
let linkId = <...>
5
let properyId = <...>
6
let path = "/node/api/links/" + linkId + "/props/" + properyId;
7
let auth = "Basic " + btoa(login + ":" + password);
8
9
let headers = new Headers();
10
headers.append("Content-Type", "application/json");
11
headers.append("Authorization", auth);
12
13
let data = JSON.stringify({
14
"name": "New Property Name"
15
});
16
17
let requestOptions = {
18
method: "PATCH",
19
headers: headers,
20
body: data
21
};
22
23
fetch(saymonHostname + path, requestOptions)
24
.then(response => response.text())
25
.then(result => console.log(result))
26
.catch(error => console.log("error", error));
Copied!
1
const http = require("http");
2
3
let login = <...>
4
let password = <...>
5
let saymonHostname = <...>
6
let linkId = <...>
7
let propId = <...>
8
let path = "/node/api/links/" + linkId + "/props/" + propId;
9
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
10
11
let options = {
12
"method": "PATCH",
13
"hostname": saymonHostname,
14
"headers": {
15
"Authorization": auth,
16
"Content-Type": "application/json"
17
},
18
"path": path
19
};
20
21
let req = http.request(options, function (res) {
22
let chunks = [];
23
24
res.on("data", function (chunk) {
25
chunks.push(chunk);
26
});
27
28
res.on("end", function (chunk) {
29
let body = Buffer.concat(chunks);
30
console.log(body.toString());
31
});
32
33
res.on("error", function (error) {
34
console.error(error);
35
});
36
});
37
38
let data = JSON.stringify({
39
"value": "New Property Value"
40
});
41
42
req.write(data);
43
req.end();
Copied!
1
import requests
2
3
login = <...>
4
password = <...>
5
saymon_hostname = <...>
6
link_id = <...>
7
property_id = <...>
8
url = "https://" + saymon_hostname + "/node/api/links/" + \
9
link_id + "/props/" + property_id
10
11
body = {
12
"value": "New Property Value"
13
}
14
15
response = requests.request("PATCH", url, json=body, auth=(login, password))
16
print(response.text)
Copied!

Response examples

1
{
2
"name": "1",
3
"value": "New Property Value",
4
"type_id": 1,
5
"id": "5e678b3678bcdb2837883491"
6
}
Copied!
Last modified 1yr ago