Get Client Configuration

Request

HTTP Request

GET /node/api/client-config

Query parameters

Parameter Type Description

format

String

Supported formats are yaml, yml and json. If you specify the format as json, this request returns a stringified JSON. If this parameter isn’t specified or contains incorrect values, this request returns configuration as a JSON object.

Request body

Request body is empty.

Response

Returns the client config in the specified format. See the Client Configuration model for a list of all fields.

Examples

  • Bash

  • JavaScript

  • NodeJS

  • Python

saymon_hostname=<...>
url=https://$saymon_hostname/node/api/client-config

curl -X GET $url
let saymonHostname = <...>
let path = "/node/api/client-config";

let requestOptions = {
    method: "GET"
};

fetch(saymonHostname + path, requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log("error", error));
const http = require("http");

let saymonHostname = <...>
let path = "/node/api/client-config";

let options = {
    "method": "GET",
    "hostname": saymonHostname,
    "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

saymon_hostname = <...>
url = "https://" + saymon_hostname + "/node/api/client-config"

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

Response

{
    "title": "SAYMON",
    "comet": {
        "port": ...
    },
    "pollInterval": 5000,
    "pollIntervalSocket": 60000,
    "geoMap": {
        "initialPosition": [
            4.355638,
            -157.203189
        ],
        "initialZoom": 8
    },
    "regionColor": {
        "1": "rgba(206, 134, 247, 0.1)",
        "3": "rgba(4, 147, 12, 0.1)",
        "4": "rgba(255, 0, 0, 0.1)",
        "5": "rgba(253, 118, 7, 0.1)",
        "7": "rgba(250, 190, 40, 0.56)",
        "8": "rgba(129, 0, 0, 0.56)",
        "9": "rgba(190, 190, 190, 0.56)"
    },
}