Update Reference

PATCH /node/api/refs/:id

Updates a reference with data provided in a request body.
Permissions: referencePermissions & (modify-objects | manage-objects).

Request parameters

Path parameters

Parameter
Type
Description
id
string
required
The ID of a reference to be updated.

Body parameters

...

Response description

...

Examples

Request examples

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

Response example

1
{
2
"id": "5e60fb67630502472925ffbf",
3
"target": "5e21b85b308c3c66d64e07c8",
4
"owner": 1,
5
"client_data": "..."
6
}
Copied!