Get All Links

GET /node/api/links

Returns a list of all links in the system (without properties).
Permissions: linkPermissions.

Request parameters

Query parameters

Parameter
Type
Description
field
String
optional
A comma-separated list of links' fields to be retrieved.

Response description

Field
Type
Description
links
Array<Link>
An array of links.

Examples

Request examples

Way to get links with all fields, except for properties:
Bash
JavaScript
NodeJS
Python
1
login=<...>
2
password=<...>
3
saymon_hostname=<...>
4
url=https://$saymon_hostname/node/api/links
5
6
curl -X GET $url -u $login:$password
Copied!
1
let login = <...>
2
let password = <...>
3
let saymonHostname = <...>
4
let path = "/node/api/links";
5
let auth = "Basic " + btoa(login + ":" + password);
6
7
let headers = new Headers();
8
headers.append("Authorization", auth);
9
10
let requestOptions = {
11
method: "GET",
12
headers: headers
13
};
14
15
fetch(saymonHostname + path, requestOptions)
16
.then(response => response.text())
17
.then(result => console.log(result))
18
.catch(error => console.log("error", error));
Copied!
1
const http = require("http");
2
3
let login = <...>
4
let password = <...>
5
let saymonHostname = <...>
6
let path = "/node/api/links";
7
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
8
9
let options = {
10
"method": "GET",
11
"hostname": saymonHostname,
12
"headers": {
13
"Authorization": auth
14
},
15
"path": path
16
};
17
18
let req = http.request(options, function (res) {
19
let chunks = [];
20
21
res.on("data", function (chunk) {
22
chunks.push(chunk);
23
});
24
25
res.on("end", function (chunk) {
26
let body = Buffer.concat(chunks);
27
console.log(body.toString());
28
});
29
30
res.on("error", function (error) {
31
console.error(error);
32
});
33
});
34
35
req.end();
Copied!
1
import requests
2
3
login = <...>
4
password = <...>
5
saymon_hostname = <...>
6
url = "https://" + saymon_hostname + "/node/api/links"
7
8
response = requests.request("GET", url, auth=(login, password))
9
print(response.text)
Copied!
Way to get links with particular fields:
Bash
JavaScript
NodeJS
Python
1
login=<...>
2
password=<...>
3
saymon_hostname=<...>
4
url=http://$saymon_hostname/node/api/links?fields=source,target
5
6
curl -X GET $url -u $login:$password
Copied!
1
let login = <...>
2
let password = <...>
3
let saymonHostname = <...>
4
let path = "/node/api/links?fields=source,target"
5
let auth = "Basic " + btoa(login + ":" + password)
6
var myHeaders = new Headers();
7
8
myHeaders.append("Authorization", auth);
9
10
let requestOptions = {
11
method: 'GET',
12
headers: myHeaders,
13
redirect: 'follow'
14
};
15
16
fetch(saymonHostname + path, requestOptions)
17
.then(response => response.text())
18
.then(result => console.log(result))
19
.catch(error => console.log('error', error));
Copied!
1
let http = require('follow-redirects').http;
2
let fs = require('fs');
3
let saymonHostname = <...>
4
let login = <...>;
5
let password = <...>;
6
let auth = 'Basic ' + Buffer.from(login + ':' + password).toString('base64');
7
8
9
let options = {
10
'method': 'GET',
11
'hostname': saymonHostname,
12
'path': '/node/api/links?fields=source,target',
13
'headers': {
14
'Authorization': auth
15
},
16
'maxRedirects': 20
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
req.end();
Copied!
1
import requests
2
3
login = <...>
4
password = <...>
5
saymon_hostname = <...>
6
url = 'http://' + saymon_hostname + '/node/api/links?fields=source,target'
7
8
response = requests.request("GET", url, auth=(login, password))
9
10
print(response.text)
Copied!

Response example

1
[
2
{
3
"source": "5e79baae6ec5ea28e5105caa",
4
"target": "5e79bbe86ec5ea28e5105d04",
5
"last_state_update": 1585053147047,
6
"state_id": 1,
7
"class_id": 35,
8
"id": "5e79fddb6ec5ea28e5105f65"
9
},
10
...
11
]
Copied!
Last modified 7mo ago