Get All Links (particular fields) [WIP]
GET /node/api/links

GET /node/api/links?fields=<field_1>,...,<field_n>

Returns all links with information only from specified fields.
Links' IDs are always returned, regardless of specifying the id field.

Request parameters

All usable fields are in the table below:
Field
Description
class_id
Link's class ID
client_data
Information about link's settings
created
Timestamp for the moment of link's creation
id
Link's ID
last_state_update
Timestamp for the moment of the last state changing
manual_state
Details about manually changed state
operations
Link's operations
owner_id
Link's owner ID
properties
List of link's properties and metrics' values
source
Link's source object ID
state_id
Link's state ID
tags
List of link's tags
target
Link's targeted object ID
updated
Timestamp for the moment of link's last update
weight
Link's weight coefficient

Examples

Request examples

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": 131,
4
"target": 130,
5
"id": 17
6
},
7
...
8
]
Copied!
Last modified 8mo ago