Get Property Class

Returns the property class with the specified ID.

Request

HTTP Request

GET /node/api/property-classes/:id

Path parameters

Parameter Type Description

id

String
required

The ID of the property class.

Request body

Request body is empty.

Response

Response body contains a property classes specified by the ID.

Модель класса свойств
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.

Example

Request

  • Bash

  • JavaScript

  • NodeJS

  • Python

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

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

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

let requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch(saymonHostname + path, requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
let http = require('follow-redirects').http;
let fs = require('fs');

let login = <...>
let password = <...>
let saymonHostname = <...>
let classId = <...>
let path = "/node/api/property-classes/" + classId;
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");

let options = {
  'method': 'GET',
  'hostname': '192.168.1.101',
  'path': '/node/api/property-classes/4',
  'headers': {
    'Authorization': auth
  },
  'maxRedirects': 20
};

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 = <...>
class_id = <...>
url = "http://" + saymon_hostname + "/node/api/property-classes/" + class_id

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

Response

{
    "name": "Date",
    "description": "",
    "value_type_id": "date",
    "value": null,
    "multiple": false,
    "source": "",
    "mask": "",
    "system": true,
    "id": "66e05cc8eef8ab1269a88797"
}