Get Class by ID
Returns the class with the specified ID.
Request
HTTP Request
Path parameters
Parameter | Type | Description |
---|---|---|
id | Stringrequired |
The ID of the class to be retrieved. |
Request body
The request body is empty.
Response
Returns the class in the JSON format. See the Class model page for more information.
Example
Request
let login = <...>
let password = <...>
let saymonHostname = <...>
let classID = <...>
let auth = "Basic " + btoa(login + ":" + password)
let path = "/node/api/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/classes/" + classId;
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
let options = {
'method': 'GET',
'hostname': '192.168.1.101',
'path': '/node/api/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();