Get All Property Classes.

Retrieves a list of all property classes.

Request

HTTP Request

GET /node/api/property-classes

Request body

Request body is empty.

Response

Response body contains a list of all property classes in the system.

Модель класса свойств
Field Type Description

name

String

Name of the property class.

description

String

Description of the property class.

value_type_id

String

ID of the value type this property class uses.

value

Object

Default value of the property.

multiple

Boolean

Whether this property class has multiple values per key.

source

String

ID of the dictionary used as the source of the values for dictionary value type.

mask

String

Filter for the acceptable value that is defined with a regular expression.

system

Boolean

Whether this is a built-in property class.

id

String

ID of the property class.

multiple_separator

String

String that separates multiple values when displayed in the web interface.

value_display_template

String

Template used when displaying values in a web interface. You can use {{0}} to access the property’s value.

Dictionaries use the following indexing – you can access the key with {{0}}; {{1}}{{N}} used to access dictionary’s values.

[
    {
        "name": "Date",
        "description": "",
        "value_type_id": "date",
        "value": null,
        "multiple": false,
        "source": "",
        "mask": "",
        "system": true,
        "id": "66e05cc8eef8ab1269a88797"
    },
    {
        "name": "DateTime",
        "description": "",
        "value_type_id": "datetime",
        "value": null,
        "multiple": false,
        "source": "",
        "mask": "",
        "system": true,
        "id": "66e05cc8eef8ab1269a88796"
    },
    ...
]

Example

Request

  • Bash

  • JavaScript

  • NodeJS

  • Python

login=<...>
password=<...>
saymon_hostname=<...>
url=https://$saymon_hostname/node/api/property-classes/

curl -X GET $url -u $login:$password
let login = <...>
let password = <...>
let saymonHostname = <...>
let path = "/node/api/property-classes/";
let auth = "Basic " + btoa(login + ":" + password);

let headers = new Headers();
headers.append("Authorization", auth);

let requestOptions = {
    method: "GET",
    headers: headers
};

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 path = "/node/api/property-classes/";
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");

let options = {
    "method": "GET",
    "hostname": saymonHostname,
    "headers": {
        "Authorization": auth
    },
    "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);
    });
});

req.end();
import requests

login = <...>
password = <...>
saymon_hostname = <...>
url = "https://" + saymon_hostname + "/node/api/property-classes/"

response = requests.request("GET", url, auth=(login, password))
print(response.text)

Response

[
  {
          "class_id": 35,
          "source": "56658fd721eed1df4a9ba5ef",
          "state_id": 3,
          "target": "566965ff6fddd44f472423ff",
          "last_state_update": 1660168711520,
          "source_name": "source obj",
          "target_name": "target obj",
          "id": "5669660b6fddd44f47242401"
  },
  {
          "class_id": 35,
          "source": "567030ad73c5248568ce7728",
          "state_id": 3,
          "target": "56702ff073c5248568ce771d",
          "last_state_update": 1660168703038,
          "source_name": "source obj",
          "target_name": "target obj",
          "id": "567031be73c5248568ce7733"
  },
  {
          "class_id": 35,
          "source": 127,
          "state_id": 9,
          "target": 112,
          "last_state_update": null,
          "source_name": "source obj",
          "target_name": "target obj",
          "id": "56fce71063c02bcb447943c6"
  }
  ...
]