To get started with the SvanLINK application, follow these steps:
unzip svanlink_os_osType.zip
cd svanlink
chmod +x svanlink chmod +x restart
sudo ./svanlink
Run the installation file and follow the instructions.
The API requests by default are sent to local address on TCP port 8000.
In browser under the local address on port 80 (default http port) should be available UI of the
app. For example: http://localhost
Run the installation file and follow the instructions.
The API requests by default are sent to local address on TCP port 8000.
In browser under the local address on port 3000 (default http port) should be available UI of the
app. For example: http://localhost:3000
AuthenticationSvanLINK API uses token-based authentication to secure access to all endpoints. Authentication is required for all API requests except for the initial login request.
token parameter.When authentication fails, the API will return an error response:
{
"Request": "endpointName",
"Status": "error",
"StatusMessage": "Invalid token"
}
For WebSocket connections, authentication can be performed in two ways:
// 1. Login to obtain token
{
"Request": "login",
"Params": {
"password": "your_password"
}
}
// 2. Use token in subsequent requests
{
"Request": "getStatus",
"token": "your_token_here"
}
// 3. Logout when done
{
"Request": "logout",
"token": "your_token_here"
}
General Error HandlingAll SvanLINK API endpoints follow a consistent error response format. Understanding these error patterns will help you handle errors gracefully in your applications.
When an error occurs, the API returns a JSON response with the following structure:
{
"Request": "endpointName",
"Status": "error",
"StatusMessage": "Description of the error"
}
Request: Reflects back the original request type that caused the error.Status: Always set to "error" for failed requests.StatusMessage: A human-readable description of what went wrong.For unhandled or unexpected errors, the API returns a generic error message:
{
"Request": "endpointName",
"Status": "error",
"StatusMessage": "An unhandled error occurred during execution. Please try again!"
}
In addition to the JSON error response, the API may also return appropriate HTTP status codes:
WebSocket ConfigurationThis configuration is used to set up WebSocket communication. The configuration specifies the intervals at which different types of data are sent automatically. The settings are saved, and on reconnection, SvanLINK will continue to send results according to the configured intervals. The maximum number of simultaneous connections is 20 clients.
The configuration must be sent via WebSocket connection. Default port is 8001
From version 1.1.0 was introduced such a concept as channels. Channel represents under a name a request (or set of requests) which will be preconfigured and sent automatically according to configured intervals. This allows to listen to different sets of requests by different clients.
When the WebSocket connection is opened, the first step is to authenticate. This can be done by sending a login request or by sending only the token (as a string) which was generated previously.
To configure the broadcast of data the SvanLINK will accept a list of "Requests". Each item in the list contains a desired type of request (the requests are described below in the documentation) and an interval (ms) at which the data must be sent.
{
"Channel": "main", //Optional, default is "main"
"Requests": [
{
"Request": "getResults",
"Interval": 1000, // Interval in milliseconds (ms). Minimum interval is 100ms.
"startSync": 1 // Optional: align first emission to next multiple of N seconds (default: 1).
},
{
"Request": "getSpectrumResults",
"Interval": 5000, // Interval in milliseconds (ms). Minimum interval is 100ms.
"startSync": 60 // Optional: start on the next whole minute boundary.
}
]
}
Channel: The name of the channel. Default is "main".Requests: An array of request objects.Request: The type of data request. Currently available requests are:
getFileList - Get list of filesgetResults - Get measurement resultsgetSpectrumResults - Get spectrum resultsgetStatus - Get device statusesgetVersion - Get version informationlicenseStatus - Get license statussendRawCommand - Send raw command to devicestartMeasurement - Start measurementInterval: The interval in milliseconds (ms) at which the data is sent. Minimum interval is 100ms.startSync (optional): Delays the first emission so it starts on the next multiple of startSync seconds from the Unix epoch. Default is 1 (starts at the next whole second). Example: 60 starts on the next whole minute, 3600 on the next whole hour. Useful for aligning multiple channels or topics to the same time grid.The response indicates that the configuration has been successfully applied, and data will be sent automatically according to the configured intervals.
{
"Channel": "main",
"Status": "ok",
"Response": {
"message": "Configuration applied successfully"
}
}
message: A message indicating that the configuration has been successfully
applied.Securing the connection (optional)To secure the connection between the client and the SvanLINK application, you can configure SSL certificates. This will enable encrypted communication, ensuring that data transmitted between the client and the server is secure.
cert.pem (the certificate) and key.pem (the private key).
certificates folder within the SvanLINK application
directory:
mv path/to/cert.pem certificates/ mv path/to/key.pem certificates/
Once the certificates are in place, restart the SvanLINK application. You should see a log message indicating that the WebSocket server is starting with SSL:
"Starting UI with SSL" or "Starting TCP server with SSL" or "Starting WebSocket server with SSL"
If the certificates are not found, the WebSocket server will start without SSL:
"Starting UI without SSL" or "Starting TCP server without SSL" or "Starting WebSocket server without SSL"
MQTT ConfigurationMQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol designed for IoT (Internet of Things) applications. SvanLINK supports MQTT to enable automatic publishing of measurement data, device status, and other information to an MQTT broker, allowing integration with external systems, dashboards, and data processing platforms.
SvanLINK acts as an MQTT client that connects to an MQTT broker. Once configured, SvanLINK can automatically publish data to the broker at specified intervals. The system uses a topic-based configuration similar to WebSocket channels, where each topic represents a set of requests that are published periodically.
The following API endpoints are available for configuring and managing MQTT functionality:
The following request types can be configured for automatic MQTT publishing:
getFileList - Get list of filesgetResults - Get measurement resultsgetSpectrumResults - Get spectrum resultsgetStatus - Get device statusesgetVersion - Get version informationlicenseStatus - Get license statussendRawCommand - Send raw command to devicestartMeasurement - Start measurementWhen data is published to the MQTT broker, each message includes:
"main", "deviceStatus")"YYYY-MM-DDTHH:mm:ss.SSS"Code Examples
// JavaScript
async function makeRequest() {
try {
// Create the payload
const payload = {
Request: "getResults",
Params: {
results: ["LAeq", "LCeq"],
devices: ["123456", "654235"],
average: "true"
},
token: "userToken"
};
// Send the POST request
const response = await fetch('http://localhost:8000/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
});
// Check if response is OK
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
// Parse and print the JSON response
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
} catch (error) {
console.error('Error:', error.message);
}
}
// Execute the request
makeRequest();
loginThis configuration is used to set up WebSocket communication. The configuration specifies the intervals at which different types of data are sent automatically. The settings are saved, and on reconnection, SvanLINK will continue to send results according to the configured intervals. The maximum number of simultaneous connections is 20 clients.
The configuration must be sent via WebSocket connection. Default port is 8001
From version 1.1.0 was introduced such a concept as channels. Channel represents under a name a request (or set of requests) which will be preconfigured and sent automatically according to configured intervals. This allows to listen to different sets of requests by different clients.
When the WebSocket connection is opened, the first step is to authenticate. This can be done by sending a login request or by sending only the token (as a string) which was generated previously.
To configure the broadcast of data the SvanLINK will accept a list of "Requests". Each item in the list contains a desired type of request (the requests are described below in the documentation) and an interval (ms) at which the data must be sent.
{
"Channel": "main", //Optional, default is "main"
"Requests": [
{
"Request": "getResults",
"Interval": 1000, // Interval in milliseconds (ms). Minimum interval is 100ms.
"startSync": 1 // Optional: align first emission to next multiple of N seconds (default: 1).
},
{
"Request": "getSpectrumResults",
"Interval": 5000, // Interval in milliseconds (ms). Minimum interval is 100ms.
"startSync": 60 // Optional: start on the next whole minute boundary.
}
]
}
Channel: The name of the channel. Default is "main".Requests: An array of request objects.Request: The type of data request. Currently available requests are:
getFileList - Get list of filesgetResults - Get measurement resultsgetSpectrumResults - Get spectrum resultsgetStatus - Get device statusesgetVersion - Get version informationlicenseStatus - Get license statussendRawCommand - Send raw command to devicestartMeasurement - Start measurementInterval: The interval in milliseconds (ms) at which the data is sent. Minimum interval is 100ms.startSync (optional): Delays the first emission so it starts on the next multiple of startSync seconds from the Unix epoch. Default is 1 (starts at the next whole second). Example: 60 starts on the next whole minute, 3600 on the next whole hour. Useful for aligning multiple channels or topics to the same time grid.The response indicates that the configuration has been successfully applied, and data will be sent automatically according to the configured intervals.
{
"Channel": "main",
"Status": "ok",
"Response": {
"message": "Configuration applied successfully"
}
}
message: A message indicating that the configuration has been successfully
applied.Securing the connection (optional)To secure the connection between the client and the SvanLINK application, you can configure SSL certificates. This will enable encrypted communication, ensuring that data transmitted between the client and the server is secure.
cert.pem (the certificate) and key.pem (the private key).
certificates folder within the SvanLINK application
directory:
mv path/to/cert.pem certificates/ mv path/to/key.pem certificates/
Once the certificates are in place, restart the SvanLINK application. You should see a log message indicating that the WebSocket server is starting with SSL:
"Starting UI with SSL" or "Starting TCP server with SSL" or "Starting WebSocket server with SSL"
If the certificates are not found, the WebSocket server will start without SSL:
"Starting UI without SSL" or "Starting TCP server without SSL" or "Starting WebSocket server without SSL"
MQTT ConfigurationMQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol designed for IoT (Internet of Things) applications. SvanLINK supports MQTT to enable automatic publishing of measurement data, device status, and other information to an MQTT broker, allowing integration with external systems, dashboards, and data processing platforms.
SvanLINK acts as an MQTT client that connects to an MQTT broker. Once configured, SvanLINK can automatically publish data to the broker at specified intervals. The system uses a topic-based configuration similar to WebSocket channels, where each topic represents a set of requests that are published periodically.
The following API endpoints are available for configuring and managing MQTT functionality:
The following request types can be configured for automatic MQTT publishing:
getFileList - Get list of filesgetResults - Get measurement resultsgetSpectrumResults - Get spectrum resultsgetStatus - Get device statusesgetVersion - Get version informationlicenseStatus - Get license statussendRawCommand - Send raw command to devicestartMeasurement - Start measurementWhen data is published to the MQTT broker, each message includes:
"main", "deviceStatus")"YYYY-MM-DDTHH:mm:ss.SSS"loginThe login API is used to authenticate a user by providing a password. If the password is correct,
the user is granted access to the system and receives a token.
{
"Request": "login",
"Params": {
"password": "Svantek312"
}
}
Request: The type of request, which is "login" in this case.Params: An object containing the parameters for the request.
password: The password for authentication.If the password is correct, the response will indicate a successful login and provide a token.
{
"Request": "login",
"Status": "ok",
"Response": {
"token": "userToken",
"message": "Login successful"
}
}
Request: Reflects back the original request type ("login").Status: The status of the request ("ok" for successful requests).
Response: An object containing the response data.
token: The token provided upon successful login. It must be
supplied into any other request described below.message: A message indicating that the login was successful.If the password is incorrect, the response will indicate an error.
{
"Request": "login",
"Status": "error",
"StatusMessage": "Wrong password"
}
Request: Reflects back the original request type ("login").Status: The status of the request ("error" for failed requests).
StatusMessage: A message indicating the reason for the error (e.g.,
"Wrong password").
Note. It is highly recommended to change it to keep your data and settings safe. Use
setNewPassword request to do this.
logoutThe logout API is used to log out a user by invalidating the provided token. This will end the
user's session.
{
"Request": "logout",
"token": "userToken"
}
Request: The type of request, which is "logout" in this case.
Params: An object containing the parameters for the request.
token: The token for the user session to be invalidated.If the token is valid, the response will indicate a successful logout.
{
"Request": "logout",
"Status": "ok",
"Response": {
"message": "Logout successful"
}
}
Request: Reflects back the original request type ("logout").Status: The status of the request ("ok" for successful requests).
Response: An object containing the response data.
message: A message indicating that the logout was successful.If the token is invalid, the response will indicate an error.
{
"Request": "logout",
"Status": "error",
"StatusMessage": "Invalid token"
}
Request: Reflects back the original request type ("logout").Status: The status of the request ("error" for failed requests).
StatusMessage: A message indicating the reason for the error (e.g.,
"Invalid token").
setNewPassword
The setNewPassword API allows an authenticated user to change their password. The user must provide
their current password and enter the new password twice for confirmation. The new password must be at least 8
characters long and contain at least one uppercase letter, one lowercase letter.
{
"Request": "setNewPassword",
"Params": {
"oldPassword": "currentPassword", // The current password.
"newPassword": "newPassword", // The new password.
"newPassword2": "newPassword" // Repeat of the new password for confirmation.
},
"token": "userToken"
}
oldPassword (required): The user's current password.newPassword (required): The new password to set.newPassword2 (required): The new password repeated for confirmation. Must
match newPassword.token (required): Authentication token for the session.If the password is changed successfully, the response will indicate success.
{
"Request": "setNewPassword",
"Status": "ok",
"Response": {
"message": "Password changed successfully"
}
}
Request: Reflects back the original request type
("setNewPassword").Status: The status of the request ("ok" for successful requests).
Response: An object containing the result message.If the request fails, an error response is returned.
{
"Request": "setNewPassword",
"Status": "error",
"StatusMessage": "Incorrect password"
}
StatusMessage: A message describing the reason for the error (e.g., incorrect
old password, new passwords do not match, etc.).Note. To reset the password to default it is needed to remove the password file with the same
name.
On Linux systems it is located in the SvanLINK's folder.
On Windows it is located in C:\Users\YourUserName\AppData\Local\Svantek\SvanLINK\
licenseStatusThe licenseStatus API retrieves the current license status of the device. The response includes
the status of the license, the license end date, the device ID, and a message regarding the license status.
{
"Request": "licenseStatus",
"token": "userToken"
}
The response contains the current license status of the device.
{
"Request": "licenseStatus",
"Status": "ok",
"Response": {
"licenseStatus": "active",
"deviceId": "XXXXXXXXXXXXXXXX",
"licenseMessage": "The license is active"
}
}
licenseStatus: The current status of the license (active, expired, noLicense,
error).deviceId: The ID of the device.licenseMessage: A message regarding the license status.setLicenseThe setLicense API activates a new license key for the device. You can provide the license key
encoded in a Base64 string, and the API will activate it for the device.
Important note. There are 2 types of licenses: hardware and device. "Hardware licence" attaches the app to the current hardware configuration (PC, laptop, server, Raspberry Pi etc) on which the app is running. The "device license" is attached to Svantek device.
{
"Request": "setLicense",
"Params": {
"key": "License key file encoded in Base64" // License key encoded in Base64
},
"token": "userToken"
}
key: The license key encoded in a Base64 string.The response indicates whether the license key was successfully activated for the device.
{
"Request": "setLicense",
"Status": "ok",
"Response": {
"licenseStatus": "active",
"deviceId": "1424422045401",
"licenseMessage": "The license was activated successfully"
}
}
licenseStatus: The current status of the license (e.g., "active").deviceId: The ID of the device.licenseMessage: A message regarding the license status.getStatusThe getStatus API retrieves the status of specified devices. You can request specific device
serial numbers, and the API will return the corresponding status data in the response.
{
"Request": "getStatus",
"Params": {
"devices": ["113200", "223200"] // Optional: List of device serial numbers.
},
"token": "userToken"
}
devices (optional): A list of device serial numbers. If not provided, status
data for all available devices will be returned.The response contains the status data for each requested device.
{
"Request": "getStatus",
"Status": "ok",
"Response": [
{
"serial": "113200",
"type": "SV 303",
"deviceName": "Demo_1",
"firmware": "1.03.9",
"battery": 90,
"memorySize": 8.2,
"memoryFree": 30,
"measurementStatus": "start",
"measurementType": "1/3 Octave",
"intPeriod": 30,
"svannet": false,
"status": "ok"
},
{
"serial": "223200",
"type": "SV 303",
"deviceName": "Demo_2",
"firmware": "1.03.7",
"battery": 33,
"memorySize": 32.0,
"memoryFree": 54,
"measurementStatus": "stop",
"measurementType": "1/1 Octave",
"intPeriod": 0,
"svannet": false,
"status": "ok"
}
]
}
Request: Reflects back the original request type ("getStatus").
Status: The status of the request ("ok" for successful requests).
Response: An array of objects containing status data for the requested
devices.serial: The serial number of the device.type: The type of the device (e.g., "SV 303").deviceName: The name of the device.firmware: The firmware version of the device.battery: The battery level of the device (percentage).memorySize: The total memory size of the device (GB).memoryFree: The free memory of the device (percentage).measurementStatus: The measurement status of the device (e.g.,
"start", "stop").
measurementType: The type of measurement being performed (e.g.,
"1/3 Octave", "1/1 Octave").
intPeriod: The integration period for the measurement (seconds, 0
for infinity).svannet: Whether the device is connected to SvanNET.status: Device status (e.g., "ok").getStatus. Use getFileListFromSvanlink and the afdSyncDate field in each device object.getResultsThe getResults API retrieves measurement results for specified devices. You can request specific
result types and device serial numbers, and the API will return the corresponding data in the response.
{
"Request": "getResults",
"Params": {
"results": ["LAeq", "LCeq"], // Optional: List of result types to fetch.
"devices": ["123456", "654235"], // Optional: List of device serial numbers.
"average": "true", // Required: Whether to return averaged results.
"vibrationsDB": false // Optional: Whether to show vibrations in dB instead of mm/s or m/s².
},
"token": "userToken"
}
results (optional): A list of result types to retrieve. Examples include:
"LAeq": Equivalent continuous sound level A-weighted."LCeq": Equivalent continuous sound level C-weighted.devices (optional): A list of device serial numbers. If not provided, data for
all available devices will be returned.average (required): A boolean value ("true" or
"false") indicating whether to return averaged results.
vibrationsDB (optional): A boolean value indicating whether to show vibrations
in dB instead of mm/s or m/s². Defaults to false.token (required): Authentication token for the session.The response contains the requested measurement data for each device.
{
"Request": "getResults",
"Status": "ok",
"Response": [
{
"serial": "123456",
"type": "SV 303",
"status": "ok",
"measurement": "start",
"measurementMode": "sound",
"results": [
{
"name": "LAeq",
"value": 100.0,
"unit": "dB"
},
{
"name": "LCeq",
"value": 112.1,
"unit": "dB"
}
]
},
{
"serial": "654235",
"type": "SV 303",
"status": "ok",
"measurement": "start",
"measurementMode": "sound",
"results": [
{
"name": "LAeq",
"value": 98.2,
"unit": "dB"
},
{
"name": "LCeq",
"value": 88.8,
"unit": "dB"
}
]
}
]
}
Request: Reflects back the original request type ("getResults").
Status: The status of the request ("ok" for successful requests).
Response: An array of objects containing measurement data for the requested
devices.serial: The serial number of the device.type: The type of the device (e.g., "SV 303").status: Device status (e.g., "ok", "disconnected").measurement: Current measurement state (e.g., "start", "stop").measurementMode: The mode of measurement: "sound", "vibrations", or "meteo".results: An array containing the measurement results for the device.
name: The type of result (e.g., "LAeq", "LCeq").
value: The measured value for the result.unit: The unit of the result (e.g., "dB" for decibels).
{
"Request": "getResults",
"Status": "error",
"Error": "Missing required parameters"
}
{
"Request": "getResults",
"Status": "error",
"Error": "Invalid parameter format"
}
results nor devices are provided, the API will return all available
data for all devices.average parameter is mandatory and determines whether the results should be averaged across
measurements.getSpectrumResultsThe getSpectrumResults API retrieves spectrum results for specified devices. You can request
specific spectrum types and device serial numbers, and the API will return the corresponding data in the
response.
{
"Request": "getSpectrumResults",
"Params": {
"devices": ["123456", "654235"], // Optional: List of device serial numbers.
"vibrationsDB": false // Optional: Whether to show vibrations in dB instead of mm/s or m/s².
},
"token": "userToken"
}
devices (optional): A list of device serial numbers. If not provided, data for
all available devices will be returned.vibrationsDB (optional): A boolean value indicating whether to show vibrations
in dB instead of mm/s or m/s². Defaults to false.token (required): Authentication token for the session.The response contains the requested spectrum data for each device.
{
"Request": "getSpectrumResults",
"Status": "ok",
"Response": [
{
"serial": "123456",
"type": "SV 303",
"status": "ok",
"measurement": "start",
"resultLabel": "LZeq",
"resultType": "1/1 Octave",
"measurementMode": "sound",
"results": [
{name: "31.5", value: 59.55, unit: "dB"}
{name: "63", value: 47.22, unit: "dB"}
{name: "125", value: 41.01, unit: "dB"}
{name: "250", value: 41.21, unit: "dB"}
{name: "500", value: 38.36, unit: "dB"}
{name: "1.0k", value: 38.69, unit: "dB"}
{name: "2.0k", value: 40.36, unit: "dB"}
{name: "4.0k", value: 35.02, unit: "dB"}
{name: "8.0k", value: 30.13, unit: "dB"}
{name: "16k", value: 32.06, unit: "dB"}
{name: "A", value: 44.92, unit: "dB"}
{name: "C", value: 61.96, unit: "dB"}
{name: "Z", value: 72.56, unit: "dB"}
]
},
{
"serial": "654235",
"type": "SV 303",
"status": "ok",
"measurement": "start",
"resultLabel": "LZeq",
"resultType": "1/1 Octave",
"measurementMode": "sound",
"results": [
{name: "31.5", value: 60.11, unit: "dB"}
{name: "63", value: 44.22, unit: "dB"}
{name: "125", value: 32.01, unit: "dB"}
{name: "250", value: 41.23, unit: "dB"}
{name: "500", value: 38.54, unit: "dB"}
{name: "1.0k", value: 38.69, unit: "dB"}
{name: "2.0k", value: 40.36, unit: "dB"}
{name: "4.0k", value: 35.34, unit: "dB"}
{name: "8.0k", value: 35.13, unit: "dB"}
{name: "16k", value: 32.23, unit: "dB"}
{name: "A", value: 44.92, unit: "dB"}
{name: "C", value: 61.96, unit: "dB"}
{name: "Z", value: 66.56, unit: "dB"}
]
}
]
}
Request: Reflects back the original request type
("getSpectrumResults").Status: The status of the request ("ok" for successful requests).
Response: An array of objects containing spectrum data for the requested
devices.serial: The serial number of the device.type: The type of the device (e.g., "303").status: "ok" if no error detected.measurement: The measurement status of the device (e.g., "start",
"stop").
resultLabel: The label of the spectrum result.resultType: The type of spectrum result (e.g., "1/1 Octave",
"1/3 Octave").
measurementMode: The mode of measurement "sound|vibrations".results: An array containing the spectrum data for the device.
name: The type of frequency.data: The spectrum data array.unit: The unit of the result (e.g., "dB" for decibels).
{
"Request": "getSpectrumResults",
"Status": "error",
"Error": "Missing required parameters"
}
{
"Request": "getSpectrumResults",
"Status": "error",
"Error": "Invalid parameter format"
}
spectrumTypes nor devices are provided, the API will return all
available spectrum data for all devices.getResultsHistoryThe getResultsHistory API retrieves historical measurement results (time history) for specified devices. Unlike getResults which returns the current snapshot, this API returns time-series data for each result type over a configurable period.
{
"Request": "getResultsHistory",
"Params": {
"period": 3600,
"average": false,
"results": ["Lp", "Leq", "Lmax"],
"devices": ["123456", "654235"],
"vibrationsDB": false
},
"token": "userToken"
}
period (optional): Time range in seconds. Defaults to 300 (5 minutes).average (optional): Whether to return averaged values. Defaults to false.results (optional): List of result types to fetch (e.g., ["Lp", "Leq", "Lmax"]). If omitted, all available result types are returned.devices (optional): List of device serial numbers. If not provided, data for all available devices is returned.vibrationsDB (optional): Whether to show vibrations in dB. Defaults to false.The response contains time-series data for each device. Each result type has a values array with one value per second (oldest first).
{
"Request": "getResultsHistory",
"Status": "ok",
"Response": [
{
"serial": "123456",
"type": "SV 104",
"status": "ok",
"timestamp": 1739368245000,
"results": [
{
"name": "Lp",
"values": [65.2, 64.8, 65.1, 67.6, 66.0],
"unit": "dB"
},
{
"name": "Leq",
"values": [65.0, 64.9, 65.1, 67.7, 65.5],
"unit": "dB"
}
]
}
]
}
Request: Reflects back the original request type ("getResultsHistory").Status: The status of the request ("ok" for successful requests).Response: An array of device objects containing time-series data.serial: The serial number of the device.type: The type of the device.status: Device status (e.g., "ok").timestamp: Unix timestamp in milliseconds of the most recent real measurement for this device. It is not advanced while the device is offline or during gap periods, so the UI can align the newest sample on the chart's time axis. Omitted if the device has not produced any real measurement yet.results: Array of result objects, each with name, values (array of numbers or null), and unit.values array contains one value per second; null indicates missing data. It may appear due to frequent requests to the SvanLINK or due to AFD (Automatic File Download) functionality, but the results are stored in measurement file.null entries may extend the window up to the current time when a device has been silent — treat them as gaps in the time-series.getSpectrumHistoryThe getSpectrumHistory API retrieves historical spectrum results (time history) for specified devices. Unlike getSpectrumResults which returns the current snapshot, this API returns time-series data for each frequency band over a configurable period.
{
"Request": "getSpectrumHistory",
"Params": {
"period": 3600,
"devices": ["123456", "654235"],
"results": ["8.0", "10.0", "[X] 8.0"],
"vibrationsDB": false
},
"token": "userToken"
}
period (optional): Time range in seconds. Defaults to 300 (5 minutes).devices (optional): List of device serial numbers. If not provided, data for all available devices is returned.results (optional): List of frequency-band labels to fetch. If omitted, all bands are returned.
"8.0", "10.0", "1k" match the corresponding band on sound devices (scalar value) and on vibration devices ([X, Y, Z] array value — see below)."[X] 8.0", "[Y] 8.0", "[Z] 8.0" select a single axis from a vibration spectrum; the returned values for that entry are scalars.vibrationsDB (optional): Whether to show vibrations in dB. Defaults to false.The response contains time-series spectrum data for each device. Each frequency band has a values array with one value per second.
{
"Request": "getSpectrumHistory",
"Status": "ok",
"Response": [
{
"serial": "123456",
"type": "SV 104",
"status": "ok",
"timestamp": 1739368245000,
"results": [
{
"name": "8.0",
"values": [45.2, 44.8, 45.1, 45.4, 46.0],
"unit": "dB"
},
{
"name": "10.0",
"values": [42.1, 41.9, 42.3, 45.5, 43.0],
"unit": "dB"
}
]
}
]
}
When the device is a vibration meter (e.g. SV 803/804/979) and the caller does not filter by axis, each sample of values is a 3-element array [X, Y, Z]. Any element may be null.
{
"Request": "getSpectrumHistory",
"Status": "ok",
"Response": [
{
"serial": "92093",
"type": "SV 979",
"status": "ok",
"timestamp": 1739368245000,
"results": [
{
"name": "8.0",
"values": [
[0.123, 0.115, 0.098],
[0.118, 0.121, 0.101],
null,
[0.124, 0.119, 0.103]
],
"unit": "mm/s"
}
]
}
]
}
If the caller filters by axis ("results": ["[X] 8.0"]), the corresponding entry becomes a scalar series:
{
"name": "[X] 8.0",
"values": [0.123, 0.118, null, 0.124],
"unit": "mm/s"
}
Request: Reflects back the original request type ("getSpectrumHistory").Status: The status of the request ("ok" for successful requests).Response: An array of device objects containing time-series spectrum data.serial: The serial number of the device.type: The type of the device.status: Device status (e.g., "ok").timestamp: Unix timestamp in milliseconds of the most recent real spectrum measurement for this device. It is not advanced while the device is offline or during gap periods. Omitted if the device has not produced any real measurement yet.results: Array of spectrum band objects. Each entry has name (frequency label, or axis-prefixed label such as "[X] 8.0" when an axis filter was requested), values (array of scalars, or array of [X, Y, Z] triples for unfiltered vibration spectra — null at any position indicates a gap), and unit.values array contains one entry per second; null indicates missing data. It may appear due to frequent requests to the SvanLINK or due to AFD (Automatic File Download) functionality, but the results are stored in measurement file.null entries may extend the window up to the current time when a device has been silent — treat them as gaps in the time-series.startMeasurementThe startMeasurement API starts measurements for specified devices. You can request specific
measurement types and device serial numbers, and the API will start the corresponding measurements.
{
"Request": "startMeasurement",
"Params": {
"devices": ["123456", "654235"] // Optional: List of device serial numbers.
},
"token": "userToken"
}
devices (optional): A list of device serial numbers. If not provided,
measurements for all available devices will be started.The response confirms that the requested measurements have been started for each device.
{
"Request": "startMeasurement",
"Status": "ok"
}
Request: Reflects back the original request type
("startMeasurement").Status: The status of the request ("ok" for successful requests).
measurementTypes nor devices are provided, the API will start all
available measurements for all devices.stopMeasurementThe stopMeasurement API stops measurements for specified devices. You can request specific
measurement types and device serial numbers, and the API will stop the corresponding measurements.
{
"Request": "stopMeasurement",
"Params": {
"devices": ["123456", "654235"] // Optional: List of device serial numbers.
},
"token": "userToken"
}
devices (optional): A list of device serial numbers. If not provided,
measurements for all available devices will be stopped.The response confirms that the requested measurements have been stopped for each device.
{
"Request": "stopMeasurement",
"Status": "ok",
}
Request: Reflects back the original request type
("stopMeasurement").Status: The status of the request ("ok" for successful requests).
measurementTypes nor devices are provided, the API will stop all
available measurements for all devices.getConfigReturns the full current SvanLINK configuration, including all application and UI settings.
{
"Request": "getConfig",
"token": "userToken"
}
{
"Request": "getConfig",
"Status": "ok",
"Response": {
"app": {
"tcpPort": 8000,
"echo": true,
"wsEnabled": true,
"wsPort": 8001,
"svannet": true,
"activeUI": true,
"disabledExternalLogin": false,
"deviceTcpServer": true,
"deviceTcpPort": 8888,
"autoDownload": {
"enabled": false,
"path": "/path/to/afd",
"deleteAfterDownload": false,
"filters": {
"fileTypes": [],
"devices": [],
"startDate": ""
},
"storageClearing": {
"storage": { "value": 10, "unit": "gb", "enabled": false },
"date": { "value": 365, "unit": "days", "enabled": false }
}
},
"mqtt": {
"enabled": true,
"host": "",
"port": 1883,
"username": "",
"ssl": false
}
},
"ui": {
"liveView": {
"resultTypes": "LAF;LAeq;LCpeak"
},
"thresholdView": {
"thresholdOrange": 45,
"thresholdRed": 75,
"k": 0,
"resultType": "LAF"
},
"currentTab": "thresholdViewTab",
"darkMode": false
}
}
}
Request: Reflects back the original request type ("getConfig").Status: "ok" on success.Response: The full configuration object.app fields:tcpPort (default 8000): Port for the TCP API and web server.echo (default true): When true, the server echoes the original request back in an "Echo" field of every response.wsEnabled (default true): Whether the WebSocket service is active.wsPort (default 8001): WebSocket port number.svannet (default true): Whether connected devices are published to SvanNET.activeUI (default true): Whether the web UI is served.disabledExternalLogin (default false): When false, external (non-localhost) clients must log in to access live results. Set to true to allow unauthenticated external access.deviceTcpServer (default true): Whether SvanLINK listens for incoming TCP connections from measurement devices.deviceTcpPort (default 8888): Port that SvanLINK listens on for device TCP connections. Devices must be configured to connect to this port.autoDownload: Auto File Download (AFD) configuration.
enabled (default false): Whether AFD is active.path: Local directory where downloaded files are stored.deleteAfterDownload (default false): Delete files from the device after downloading.filters.fileTypes: List of file extensions to download (e.g. ["SVL","WAV"]). Empty = all types.filters.devices: List of device serial numbers to download from. Empty = all devices.filters.startDate: Only download files created after this date (ISO string). Empty = no filter.storageClearing.storage: Automatically remove oldest files when storage exceeds value GB (enabled flag).storageClearing.date: Automatically remove files older than value days (enabled flag).mqtt: MQTT broker configuration.
enabled (default true): Whether the MQTT publisher is active.host: Broker hostname or IP address.port (default 1883): Broker port.username: Authentication username.ssl (default false): Whether to use SSL/TLS.ui fields:liveView.resultTypes: Semicolon-separated list of result types shown in the live view (e.g. "LAF;LAeq;LCpeak").thresholdView.thresholdOrange (default 45): Orange threshold level in dB.thresholdView.thresholdRed (default 75): Red threshold level in dB.thresholdView.k (default 0): K-factor offset applied to displayed values.thresholdView.resultType: Result type used for threshold comparison.currentTab: Last active tab identifier.darkMode (default false): Whether the dark UI theme is active.setConfigUpdates the SvanLINK configuration. Only the fields you include are changed; omitted fields keep their current values. Both app and ui must be present in the same request.
Send "Params": { "default": true } to reset all settings to factory defaults.
{
"Request": "setConfig",
"Params": {
"app": {
"tcpPort": 8000,
"echo": true,
"wsEnabled": true,
"wsPort": 8001,
"svannet": true,
"activeUI": true,
"disabledExternalLogin": false,
"deviceTcpServer": true,
"deviceTcpPort": 8888,
"autoDownload": {
"enabled": false,
"path": "/path/to/afd",
"deleteAfterDownload": false,
"filters": {
"fileTypes": [],
"devices": [],
"startDate": ""
},
"storageClearing": {
"storage": { "value": 10, "unit": "gb", "enabled": false },
"date": { "value": 365, "unit": "days", "enabled": false }
}
},
"mqtt": {
"enabled": true,
"host": "127.0.0.1",
"port": 1883,
"username": "admin",
"ssl": true,
"caCert": "base64_encoded_cert",
"certFile": "base64_encoded_cert",
"keyFile": "base64_encoded_key"
}
},
"ui": {
"liveView": {
"resultTypes": "LAF;LAeq;LCpeak"
},
"thresholdView": {
"thresholdOrange": 45,
"thresholdRed": 75,
"k": 0,
"resultType": "LAF"
},
"currentTab": "thresholdViewTab",
"darkMode": false
}
},
"token": "userToken"
}
app fields:tcpPort: Port for the TCP API and web server. Default 8000.echo: Echo the original request back in every response. Default true.wsEnabled: Enable the WebSocket service. Default true.wsPort: WebSocket port. Default 8001.svannet: Publish connected devices to SvanNET. Default true.activeUI: Serve the web UI. Default true.disabledExternalLogin: Allow unauthenticated external access to live results. Default false (login required).deviceTcpServer: Listen for incoming TCP connections from measurement devices. Default true.deviceTcpPort: Port to listen on for device TCP connections. Default 8888. Requires restart to take effect.autoDownload: Auto File Download settings (see getConfig for field descriptions).mqtt: MQTT broker settings.
enabled: Enable the MQTT publisher.host: Broker hostname or IP.port: Broker port. Default 1883.username: Authentication username.ssl: Use SSL/TLS. Default false.caCert: Base64-encoded CA certificate (server verification).certFile: Base64-encoded client certificate (mutual TLS).keyFile: Base64-encoded client private key (mutual TLS).ui fields:liveView.resultTypes: Semicolon-separated result types for the live view.thresholdView.thresholdOrange: Orange alert threshold in dB.thresholdView.thresholdRed: Red alert threshold in dB.thresholdView.k: K-factor offset.thresholdView.resultType: Result type used for threshold comparison.currentTab: Active tab to restore on next load.darkMode: Enable dark theme.
{
"Request": "setConfig",
"Status": "ok"
}
getSetupThe getSetup API retrieves the setup configuration for a specified device. You can request the
setup configuration for a specific device serial number, and the API will return the corresponding setup data in
the response.
{
"Request": "getSetup",
"Params": {
"device": "85609" // Device serial number
},
"token": "userToken"
}
device: The serial number of the device for which the setup configuration is
requested.The response contains the setup configuration data for the requested device.
{
"Request": "getSetup",
"Status": "ok",
"Response": {
"setupfile": "file encoded in Base64 string format"
}
}
setupfile: The setup configuration file encoded in a Base64 string format.
setSetupThe setSetup API uploads a setup configuration to a specified device. You can provide the setup
configuration file encoded in a Base64 string, and the API will upload it to the specified device.
{
"Request": "setSetup",
"Params": {
"device": "85609", // Device serial number
"overwrite": true, // Whether to overwrite the existing setup
"file": "file encoded in Base64 string" // Setup configuration file encoded in Base64
},
"token": "userToken"
}
device: The serial number of the device to which the setup configuration is
uploaded.overwrite: A boolean indicating whether to overwrite the existing setup.file: The setup configuration file encoded in a Base64 string.The response indicates whether the setup configuration was successfully uploaded to the device.
{
"Request": "setSetup",
"Status": "ok"
}
message: A message indicating the result of the setup upload.copySetupThe copySetup API copies a setup configuration from a source device to one or more target devices.
You can specify the source device, target devices, and whether to overwrite the existing setup on the target
devices.
{
"Request": "copySetup",
"Params": {
"sourceDevice": "85609", // Source device serial number
"targetDevices": ["112233", "453789"], // List of target device serial numbers
"overwrite": true // Whether to overwrite the existing setup on the target devices
},
"token": "userToken"
}
sourceDevice: The serial number of the source device from which the setup
configuration is copied.targetDevices: A list of serial numbers of the target devices to which the
setup configuration is copied.overwrite: A boolean indicating whether to overwrite the existing setup on the
target devices.The response indicates whether the setup configuration was successfully copied to the target devices.
{
"Request": "copySetup",
"Status": "ok"
}
message: A message indicating the result of the setup copy operation.sendRawCommandThe sendRawCommand API allows you to send # commands directly to the connected device. These
commands must follow the format and syntax specified in the device's user manual. The API sends the command to
the device and returns the response.
{
"Request": "sendRawCommand",
"Params": {
"devices": ["123456", "654235"], // Optional: List of device serial numbers.
"command": "#1,U?,N?;" // The raw command to send to the device
},
"token": "userToken"
}
command: The raw command string to be sent to the device. This must follow the
syntax specified in the device's user manual.token: The authentication token for the session.The response contains the result of the command execution on the device.
{
"Request": "sendRawCommand",
"Status": "ok",
"Response": [
{
"serial": "123456",
"response": "#1,U303,N123456;"
},
{
"serial": "654235",
"response": "#1,U303,N654235;"
}
]
}
result: A message indicating the result of the command execution.command parameter follows the syntax and format specified in the device's user
manual.token parameter is mandatory and must be valid for the session.getFileList
The getFileList API retrieves a list of files stored on devices. All parameters in
Params are optional and act as filters. If a parameter is omitted, no filtering is applied for that
field.
{
"Request": "getFileList",
"Params": {
"devices": ["3502"], // Optional: List of device serial numbers to filter.
"mode": "flat", // Optional: "flat" for a flat list, "tree" for hierarchical (default: "flat").
"types": ["TXT", "SVL"], // Optional: List of file types/extensions to filter.
"startDate": "2025-05-13 10:30:00", // Optional: Start date/time (YYYY-MM-DD HH:mm:ss) to filter files created after this date.
"endDate": "2025-5-13 11:00:00" // Optional: End date/time (YYYY-MM-DD HH:mm:ss) to filter files created before this date.
},
"token": "userToken"
}
devices (optional): List of device serial numbers. Only files from these
devices will be listed.mode (optional): "flat" for a flat file list, "tree"
for a directory tree. Default is "flat".types (optional): List of file types/extensions to include (e.g.,
"TXT", "SVL").
startDate (optional): Only include files created after this date/time.endDate (optional): Only include files created before this date/time.token (required): Authentication token.The response contains a list of files for each device matching the filters, including file name, size, creation date, and type.
{
"Request": "getFileList",
"Status": "ok",
"Response": [
{
"serial": "123456",
"type": "SV 303",
"files": [
{
"name": "/S1.SVL",
"size": 1203,
"dateCreated": "2025-05-13 10:50:40",
"type": "TXT"
},
{
"name": "/W1.WAV",
"size": 270336,
"dateCreated": "2025-05-13 10:52:28",
"type": "SVL"
}
]
}
],
}
Request: Reflects back the original request type ("getFileList").
Status: The status of the request ("ok" for successful requests).
Response: An array of objects, one per device, each containing:
serial: Device serial number.type: Device type/model.files: Array of file objects:
name: Full file path/name.size: File size in bytes.dateCreated: File creation date/time (YYYY-MM-DD HH:mm:ss).type: File type/extension (e.g., "TXT",
"SVL").
Params fields are optional and act as filters. If omitted, no filtering is applied for the
request.types is omitted, all file types are included.mode parameter controls whether the file list is flat or hierarchical.downloadCurrentFile
The downloadCurrentFile request downloads a single file from a connected device. The HTTP response is a
binary stream (not JSON): file bytes with download headers. Depending on mode, you either fetch a file by
path on the device or stream the current measurement file (SVL or WAV).
{
"Request": "downloadCurrentFile",
"Params": {
"device": "123456",
"mode": "byPath",
"value": "/S1.SVL",
"offset": 0,
"force": false
},
"token": "userToken"
}
device (required): Serial number of the device (must be connected).mode (required):
"byPath" — Download a file identified by its path on the device."current" — Download the current measurement file; value must be "SVL" or "WAV".value (required):
mode is "byPath": full path to the file (e.g. "/S1.SVL").mode is "current": "SVL" or "WAV".offset (optional): Byte offset for resuming or chunked transfer where applicable. Default 0.force (optional): Boolean. When true, bypasses serving from the Auto File Download cache for byPath where the implementation allows. Default false.token (required): Authentication token.The response body is the file as a binary stream. Clients must read the raw bytes and save or pipe them to a file.
Content-Disposition and Content-Type are set for a file download.mode: "byPath", prefer downloadFiles for downloading multiple files or when you want ZIP packaging; byPath via this request may change in future releases (see server warnings).downloadFileStatus where applicable.downloadFile (deprecated)
The request name downloadFile is a deprecated alias for downloadCurrentFile.
It accepts the same Params and behaves identically. Do not use downloadFile in new code.
It will be removed in a future SvanLINK version; migrate to downloadCurrentFile.
The sections below reproduce the original downloadFile documentation (request name and examples use downloadFile).
The downloadFile API allows you to download a specific file from a device. The response is a stream
of bytes representing the file content.
{
"Request": "downloadFile",
"Params": {
"device": "123456", // Required: Device serial number.
"mode": "byPath|current", // Required: Mode for file download.
"value": "/S1.SVL|SVL" // Required: Depending on mode, either file path or file type.
},
"token": "userToken"
}
device (required): The serial number or identifier of the device.mode (required): Mode for file download. Use "byPath" to specify
the file path, or "current" to download the current file.value (required): Depending on the mode:
"byPath": Full file path (e.g., "/S1.SVL")."current": File type (e.g., "SVL", "WAV").token (required): Authentication token.The response is a stream of bytes representing the requested file. The content type and headers are set for file download.
Content-Disposition, Content-Type) are set for file
download.downloadFiles
The downloadFiles API downloads multiple files from a device in a single request.
The response is a binary ZIP archive containing all requested files.
If a file has already been synced to SvanLINK via Auto File Download (AFD), it is served from the local AFD cache instead of re-downloading from the device.
{
"Request": "downloadFiles",
"Params": {
"device": "123456", // Required: Device serial number.
"files": [
"/path/file001.svl",
"/path/file002.wav"
], // Required: List of file paths to download.
"omit": false, // Optional: Skip availability checks entirely (default: false).
"force": false // Optional: Force live download from device, bypass AFD cache (default: false).
},
"token": "userToken"
}
device (required): The serial number of the device.files (required): List of full file paths to download.omit (optional): If true, availability checks are skipped entirely and the request proceeds regardless of whether files exist on the device or in AFD. Default is false.force (optional): If true, files are always downloaded live from the device — the AFD cache is not used. If a file is not currently available on the device and force is true, the request fails. Default is false.token (required): Authentication token.
The response is a binary ZIP archive (Content-Type: application/zip) containing the requested files.
This is not a JSON response — handle it as a binary file stream.
{device}.zip via the Content-Disposition header.force: true).omit is false (default), every file in the list must either be available on the device or present in the AFD cache. If any file fails both checks, the request returns an error before streaming begins.force is true and a file is not available on the device (even if it is in AFD), the request fails. Use this only when you specifically need a fresh copy from the device.downloadFileList. The old name is still accepted for backward compatibility but is deprecated.deleteFiles
The deleteFiles API deletes one or more files directly from a connected device.
The path parameter accepts a single file path string or a list of paths for bulk deletion.
Files are deleted sequentially — if any deletion fails, processing stops at that file and an error is returned.
{
"Request": "deleteFiles",
"Params": {
"device": "113200", // Required: Device serial number.
"path": ["/L4.SVL", "/R41.WAV"] // Required: File path string or list of paths to delete.
},
"token": "userToken"
}
device (required): The serial number of the device.path (required): A single file path string or an array of file path strings to delete from the device. The alias paths is also accepted.token (required): Authentication token.
{
"Request": "deleteFiles",
"Status": "ok",
"Response": {
"message": "Files deleted successfully"
}
}
{
"Request": "deleteFiles",
"Status": "error",
"StatusMessage": "error deleting file /L4.SVL, is measurement stopped?"
}
device parameter:
{
"Request": "deleteFiles",
"Status": "error",
"StatusMessage": "The \"device\" parameter is missing"
}
path parameter:
{
"Request": "deleteFiles",
"Status": "error",
"StatusMessage": "The \"path\" parameter is missing"
}
deleteFilesFromSvanlink.deleteFile. The old name is still accepted for backward compatibility but is deprecated.eraseDisk
The eraseDisk API erases the entire working directory on a connected measurement device — removing all files currently stored there in a single operation. Unlike deleteFiles, which deletes individual named files, eraseDisk wipes the device's working storage wholesale.
The device must have its measurement stopped before the disk can be erased. The operation is sent as a hardware-level command to the device firmware and may take several seconds to complete on large media; during that time the device may not respond to other commands.
{
"Request": "eraseDisk",
"Params": {
"device": "113200" // Required: Device serial number.
},
"token": "userToken"
}
device (required): The serial number of the target device. Must match one of the currently connected instruments.token (required): Authentication token.
{
"Request": "eraseDisk",
"Status": "ok",
"Response": {
"message": "Working directory erased"
}
}
When the device firmware accepts the erase request but does not report immediate completion, the response is returned with a warning rather than a hard success. The operation is still running; the device may be unresponsive until it finishes.
{
"Request": "eraseDisk",
"Status": "ok",
"Warnings": ["Erasing disk may take a while, device might be unresponsive"]
}
{
"Request": "eraseDisk",
"Status": "error",
"StatusMessage": "error erasing working directory, is measurement stopped?"
}
device parameter:
{
"Request": "eraseDisk",
"Status": "error",
"StatusMessage": "The \"device\" parameter is missing"
}
syncToSvanlink, the copies on SvanLINK are unaffected.stopMeasurement before calling this.requireOnAccessPoint) and a valid licence.deleteFilesFromSvanlink.getFileListFromSvanlink
The getFileListFromSvanlink API retrieves a list of files that have been downloaded to SvanLINK from devices.
This endpoint queries the Auto File Download (AFD) database and returns files that have been synced to SvanLINK,
including their download status, paths, and metadata. All parameters in Params are optional and act as filters.
{
"Request": "getFileListFromSvanlink",
"Params": {
"devices": ["3502"], // Optional: List of device serial numbers to filter.
"types": ["SVL", "WAV"] // Optional: List of file types/extensions to filter.
},
"token": "userToken"
}
devices (optional): List of device serial numbers. Only files from these
devices will be listed.types (optional): List of file types/extensions to include (e.g.,
"SVL", "WAV"). If omitted, all file types are included.token (required): Authentication token.The response contains a list of files for each device that have been downloaded to SvanLINK, including file path, size, creation date, download date, SvanLINK storage path, and download status.
{
"Request": "getFileListFromSvanlink",
"Status": "ok",
"Response": [
{
"serial": "3502",
"type": "SV 971A",
"afdSyncDate": "2026-01-12 17:34:35",
"files": [
{
"path": "/R41.WAV",
"size": 61536506,
"dateCreated": "2025-05-15 15:25:18",
"dateDownloaded": "2026-01-12 17:34:35",
"afdPath": "/path/to/afd/3502/R41_2025-05-15_15-25-18.WAV",
"status": "downloaded"
},
{
"path": "/L4129.SVL",
"size": 69550,
"dateCreated": "2025-05-15 15:25:18",
"downloadedSize": 1605632,
"afdPath": "/path/to/afd/3502/L4129_2025-05-15_15-25-18.SVL",
"status": "downloading"
}
]
}
]
}
Request: Reflects back the original request type ("getFileListFromSvanlink").
Status: The status of the request ("ok" for successful requests).
Response: An array of objects, one per device, each containing:
serial: Device serial number.type: Device type/model.afdSyncDate: Date/time of the last Auto File Download sync for this device (YYYY-MM-DD HH:mm:ss). null if no sync has occurred yet.files: Array of file objects:
path: Full file path on the device.size: File size in bytes.dateCreated: File creation date/time on device (YYYY-MM-DD HH:mm:ss).dateDownloaded (optional): Date/time when file was downloaded to SvanLINK (YYYY-MM-DD HH:mm:ss). Only present for downloaded files.downloadedSize (optional): Number of bytes already downloaded. Only present for files with status "downloading" or "current".afdPath (optional): Full path where the file is stored on SvanLINK. Only present for downloaded, deleted, or downloading files; not present for failed files.status: Download status. Possible values:
"downloaded" - File successfully downloaded to SvanLINK"downloading" - File is currently being downloaded"current" - File is currently being processed"failed" - Download failed"deleted" - File has been deleted from SvanLINKafdPath indicates where the file is stored on SvanLINK's file system.downloadedSize to track download progress.getFileListFromServer. The old name is still accepted for backward compatibility but is deprecated.syncToSvanlink
The syncToSvanlink API initiates downloading one or more files from a connected device to SvanLINK.
This request triggers the Auto File Download (AFD) system to download the specified files and store them in the configured SvanLINK storage location.
Multiple files can be submitted in a single request. Each file is processed independently — skipped files produce warnings but do not prevent other files from being queued.
{
"Request": "syncToSvanlink",
"Params": {
"device": "3502", // Required: Device serial number.
"value": ["/R41.WAV", "/L4129.SVL"], // Required: File path (string) or list of file paths.
"force": false // Optional: If true, skip the already-downloaded check (default: false).
},
"token": "userToken"
}
device (required): The serial number of the device from which to sync files.value (required): A single file path string or an array of file path strings. Each path must be the full path on the device (e.g., "/R41.WAV").force (optional): If true, files that are already marked as downloaded in the AFD database are re-queued for download without producing a warning. Default is false.token (required): Authentication token.
Returns "ok" once all requested files have been evaluated and download threads started for eligible files.
If some files were skipped (already downloaded or currently in progress), their paths are listed in Warnings.
{
"Request": "syncToSvanlink",
"Status": "ok"
}
{
"Request": "syncToSvanlink",
"Status": "ok",
"Warnings": [
"file already downloaded: /R41.WAV",
"File is beeing downloaded: /L4129.SVL"
]
}
Request: Reflects back the request type ("syncToSvanlink").Status: "ok" even when some files are skipped — warnings are non-fatal.Warnings (optional): List of per-file warning messages for skipped files. Two possible reasons:
"file already downloaded: <path>" — file has status downloaded in AFD and force is false."File is beeing downloaded: <path>" — file currently has status downloading or current; skipped regardless of force.device parameter:
{
"Request": "syncToSvanlink",
"Status": "error",
"StatusMessage": "The \"device\" parameter is missing"
}
value parameter:
{
"Request": "syncToSvanlink",
"Status": "error",
"StatusMessage": "The \"value\" parameter must be a non-empty list of file paths"
}
getFileListFromSvanlink or WebSocket downloadFileStatus messages to track progress.downloading or current status) is always skipped — force does not override this.downloadToServer. The old name is still accepted for backward compatibility but is deprecated.deleteFilesFromSvanlink
The deleteFilesFromSvanlink API deletes one or more files from SvanLINK's Auto File Download (AFD) storage.
Each file is removed from both SvanLINK's file system and the AFD database.
Multiple files can be submitted in a single request. Files not found produce warnings (not errors) when deleting in bulk, so other files in the list still proceed.
{
"Request": "deleteFilesFromSvanlink",
"Params": {
"device": "3502",
"value": [ // Required: afdPath string or list of afdPaths.
"/path/to/afd/3502/R41_2025-05-15_15-25-18.WAV",
"/path/to/afd/3502/L4129_2025-05-15_15-25-18.SVL"
]
},
"token": "userToken"
}
device (required): The serial number of the device associated with the files.value (required): A single afdPath string or an array of afdPath strings to delete. Use the afdPath values returned by getFileListFromSvanlink.token (required): Authentication token.
{
"Request": "deleteFilesFromSvanlink",
"Status": "ok"
}
{
"Request": "deleteFilesFromSvanlink",
"Status": "ok",
"Warnings": [
"Files not found: /path/to/afd/3502/missing.WAV"
]
}
{
"Request": "deleteFilesFromSvanlink",
"Status": "error",
"StatusMessage": "File not found"
}
device parameter:
{
"Request": "deleteFilesFromSvanlink",
"Status": "error",
"StatusMessage": "The \"device\" parameter is missing"
}
value parameter:
{
"Request": "deleteFilesFromSvanlink",
"Status": "error",
"StatusMessage": "The \"value\" parameter is missing"
}
downloaded or disconnected in the AFD database can be deleted. Files currently being downloaded are not eligible.getFileListFromSvanlink to retrieve the correct afdPath values.deleteFromServer. The old name is still accepted for backward compatibility but is deprecated.setAfdConfig
The setAfdConfig API allows you to configure the Auto File Download (AFD) system settings.
This includes enabling/disabling automatic downloads, setting storage paths, file type filters, date filters,
and storage clearing policies. All parameters are optional - only the parameters you provide will be updated.
{
"Request": "setAfdConfig",
"Params": {
"enabled": true, // Optional: Enable/disable Auto File Download.
"path": "/path/to/downloads", // Optional: Storage location path on SvanLINK.
"deleteAfterDownload": false, // Optional: Delete file from device after successful download.
"filters": { // Optional: File filtering configuration.
"fileTypes": ["SVL", "WAV", "CSV"], // Optional: List of file types to download.
"startDate": "2025-01-01 00:00:00" // Optional: Only download files created after this date (YYYY-MM-DD HH:mm:ss).
},
"enableStorageClearing": true, // Optional: Enable/disable storage-based clearing (size limit).
"enableDateClearing": false, // Optional: Enable/disable date-based clearing (age limit).
"storageLimit": 100, // Optional: Storage size limit value. Requires enableStorageClearing.
"storageLimitUnit": "GB", // Optional: Storage size limit unit ("MB", "GB", "TB"). Requires storageLimit.
"storageTimeLimit": 30, // Optional: Storage time limit value. Requires enableDateClearing.
"storageTimeUnit": "days" // Optional: Storage time limit unit ("days", "weeks", "months"). Requires storageTimeLimit.
},
"token": "userToken"
}
enabled (optional): Boolean to enable or disable the Auto File Download feature.path (optional): The directory path on SvanLINK where downloaded files will be stored.deleteAfterDownload (optional): Boolean to automatically delete files from devices after successful download to SvanLINK.filters (optional): An object containing file filtering options:
fileTypes (optional): Array of file type extensions to download (e.g., ["SVL", "WAV", "CSV"]). Empty array means all file types.startDate (optional): Only download files created after this date/time (format: YYYY-MM-DD HH:mm:ss).enableStorageClearing (optional): Boolean to enable or disable storage-based clearing. When enabled, files exceeding the storage size limit will be automatically deleted.enableDateClearing (optional): Boolean to enable or disable date-based clearing. When enabled, files older than the time limit will be automatically deleted.storageLimit (optional): Numeric value for storage size limit. Must be used together with storageLimitUnit. Only effective when enableStorageClearing is true.storageLimitUnit (optional): Unit for storage size limit. Valid values: "MB", "GB", "TB". Must be used together with storageLimit.storageTimeLimit (optional): Numeric value for storage time limit. Must be used together with storageTimeUnit. Only effective when enableDateClearing is true.storageTimeUnit (optional): Unit for storage time limit. Valid values: "days", "weeks", "months". Must be used together with storageTimeLimit.token (required): Authentication token.The response indicates that the configuration has been updated successfully.
{
"Request": "setAfdConfig",
"Status": "ok",
"Response": {
"message": "Configuration updated successfully"
}
}
Request: Reflects back the original request type ("setAfdConfig").Status: The status of the request ("ok" for successful requests).Response: An object containing a message about the result.enableStorageClearing) or age (enableDateClearing), or both independently.enableStorageClearing is enabled, files that exceed the configured storage size limit will be automatically deleted.enableDateClearing is enabled, files older than the configured time limit will be automatically deleted.path must be a valid directory path on SvanLINK where the application has write permissions."SVL" not "svl").filters.fileTypes is an empty array or not provided, all file types will be downloaded.deleteAfterDownload is enabled, files will be removed from devices after successful download, freeing up device storage space.getVersion
The getVersion API retrieves the current version of the SvanLINK application. This is useful for
checking which version of the software is running on SvanLINK.
{
"Request": "getVersion",
"token": "userToken"
}
Request: The type of request, which is "getVersion" in this case.
token: (required) Authentication token for the session.The response contains the current version of the SvanLINK application.
{
"Request": "getVersion",
"Status": "ok",
"Response": {
"version": "{{ version }}"
}
}
Request: Reflects back the original request type ("getVersion").
Status: The status of the request ("ok" for successful requests).
Response: An object containing the version string.checkUpdate
The checkUpdate API checks if a new version of the SvanLINK application is available. It returns information about the latest version, its release date, and changelog.
{
"Request": "checkUpdate",
"token": "userToken"
}
Request: The type of request, which is "checkUpdate" in this case.token: (required) Authentication token for the session.The response indicates whether an update is available and provides details about the latest version.
{
"Request": "checkUpdate",
"Status": "ok",
"Response": {
"available": true,
"critical": false,
"version": "1.0.0",
"date": "2025-05-01",
"changelog": "- Added new features\n- Fixed bugs\n- Improved performance"
}
}
available: true if a newer version is available, false otherwise.critical: true if the update is critical, false otherwise.version: The latest available version.date: Release date of the latest version (YYYY-MM-DD).changelog: Description of changes in the latest version.
{
"Request": "checkUpdate",
"Status": "error",
"StatusMessage": "Unable to check for updates"
}
StatusMessage: A message describing the reason for the error (e.g., network issues, authentication failure).downloadUpdate
The downloadUpdate API downloads the latest available update for the SvanLINK application. It initiates the download process or returns the current status if already in progress or completed.
{
"Request": "downloadUpdate",
"token": "userToken"
}
Request: The type of request, which is "downloadUpdate" in this case.token: (required) Authentication token for the session.The response indicates the status of the update download process.
{
"Request": "downloadUpdate",
"Status": "ok",
"Response": {
"status": "downloading|downloaded"
}
}
status: "downloaded" if the update has been downloaded, "downloading" if the download is in progress.
{
"Request": "downloadUpdate",
"Status": "error",
"StatusMessage": "Unable to download update"
}
StatusMessage: A message describing the reason for the error (e.g., network issues, authentication failure).installUpdate to install the update.installUpdate
The installUpdate API installs the latest downloaded update for the SvanLINK application. It starts the update process and may require elevated privileges depending on the operating system.
{
"Request": "installUpdate",
"token": "userToken"
}
Request: The type of request, which is "installUpdate" in this case.token: (required) Authentication token for the session.The response indicates that the update process has started.
{
"Request": "installUpdate",
"Status": "ok",
"Response": {
"status": "updating"
}
}
status: "updating" means the update process has started successfully.
{
"Request": "installUpdate",
"Status": "error",
"StatusMessage": "Error message"
}
StatusMessage: A message describing the reason for the error (e.g., missing updater file, permission issues).downloadUpdate.setMqttConfigThe setMqttConfig API configures the MQTT broker connection settings for SvanLINK. This includes the broker host, port, authentication credentials, and enables or disables the MQTT service. After configuration, the application will restart to apply the changes.
{
"Request": "setMqttConfig",
"Params": {
"enabled": true, // Optional: Enable or disable MQTT service (boolean)
"host": "mqtt.example.com", // Optional: MQTT broker host address
"port": 1883, // Optional: MQTT broker port number
"username": "mqtt_user", // Optional: MQTT broker username
"password": "mqtt_password", // Optional: MQTT broker password
"ssl": true, // Optional: A boolean indicating if the MQTT is using SSL/TLS (e.g., true).
"caCert": "base64_encoded_cert", // Optional: The CA certificate for the MQTT (e.g., "base64_encoded_cert").
"certFile": "base64_encoded_cert", // Optional: The certificate file for the MQTT (e.g., "base64_encoded_cert").
"keyFile": "base64_encoded_key" // Optional: The key file for the MQTT (e.g., "base64_encoded_key").
},
"token": "userToken"
}
enabled (optional): A boolean value to enable or disable the MQTT service. When set to true, the MQTT service will be active.host (optional): The hostname or IP address of the MQTT broker.port (optional): The port number for the MQTT broker connection (typically 1883 for non-SSL or 8883 for SSL).username (optional): The username for authenticating with the MQTT broker.password (optional): The password for authenticating with the MQTT broker. This is stored securely in a separate file.certificate (optional): SSL certificate file encoded in Base64 format for secure MQTT connections (TLS/SSL).token (required): Authentication token for the session.If the configuration is successfully applied, the response will indicate success. Note that the application will restart after a successful configuration update.
{
"Request": "setMqttConfig",
"Status": "ok"
}
Request: Reflects back the original request type ("setMqttConfig").Status: The status of the request ("ok" for successful requests).If the request fails, an error response is returned.
{
"Request": "setMqttConfig",
"Status": "error",
"StatusMessage": "Error message describing what went wrong"
}
Params are optional. Only the parameters provided will be updated.enabled to false.getMqttConfigThe getMqttConfig API retrieves the current MQTT broker configuration settings, including the broker host, port, username, and enabled status. Note that the password is not returned for security reasons.
{
"Request": "getMqttConfig",
"token": "userToken"
}
Request: The type of request, which is "getMqttConfig" in this case.token (required): Authentication token for the session.The response contains the current MQTT broker configuration.
{
"Request": "getMqttConfig",
"Status": "ok",
"Response": {
"enabled": true,
"host": "mqtt.example.com",
"port": 1883,
"username": "mqtt_user",
"ssl": true
}
}
Request: Reflects back the original request type ("getMqttConfig").Status: The status of the request ("ok" for successful requests).Response: An object containing the MQTT configuration:
enabled: A boolean indicating whether the MQTT service is enabled.host: The MQTT broker hostname or IP address.port: The MQTT broker port number.username: The MQTT broker username.null or omitted from the response.addMqttTopicThe addMqttTopic API creates or updates an MQTT topic configuration. This allows you to configure which data requests should be automatically published to the MQTT broker at specified intervals. The configuration is similar to WebSocket channel configuration.
{
"Request": "addMqttTopic",
"Params": {
"Topic": "main", // Optional: Topic name. Default is "main"
"Requests": [
{
"Request": "getResults",
"Interval": 1000, // Interval in milliseconds (ms). Minimum interval is 100ms.
"startSync": 1 // Optional: align first emission to next multiple of N seconds (default: 1).
},
{
"Request": "getSpectrumResults",
"Interval": 5000, // Interval in milliseconds (ms). Minimum interval is 100ms.
"startSync": 60 // Optional: start on the next whole minute boundary.
}
]
},
"token": "userToken"
}
Params (required): A configuration object containing:
Topic (optional): The name of the MQTT topic. Default is "main".Requests (required): An array of request objects that will be automatically published to the MQTT broker:
Request: The type of data request to publish. Available requests include:
getFileList - Get list of filesgetResults - Get measurement resultsgetSpectrumResults - Get spectrum resultsgetStatus - Get device statusesgetVersion - Get version informationlicenseStatus - Get license statussendRawCommand - Send raw command to devicestartMeasurement - Start measurementInterval: The interval in milliseconds (ms) at which the request is published. Minimum interval is 100ms.startSync (optional): Delays the first emission so it starts on the next multiple of startSync seconds from the Unix epoch. Default is 1. Example: 60 starts on the next whole minute.token (required): Authentication token for the session.If the MQTT topic is successfully created or updated, the response will indicate success.
{
"Request": "addMqttTopic",
"Status": "ok"
}
Request: Reflects back the original request type ("addMqttTopic").Status: The status of the request ("ok" for successful requests).If the request fails, an error response is returned.
{
"Request": "addMqttTopic",
"Status": "error",
"StatusMessage": "missing config param" or "config must be in json"
}
Note: The error message "missing config param" refers to the Params object being missing or empty. The error message "config must be in json" indicates that Params must be a valid JSON object.
"YYYY-MM-DDTHH:mm:ss.SSS".getMqttTopicList to see all configured MQTT topics.deleteMqttTopicThe deleteMqttTopic API deletes a specific MQTT topic configuration. This will stop all automatic data publishing for that topic and remove it from the configuration.
{
"Request": "deleteMqttTopic",
"Params": {
"topic": "main" // Required: The name of the MQTT topic to delete
},
"token": "userToken"
}
topic (required): The name of the MQTT topic to delete.token (required): Authentication token for the session.If the topic is successfully deleted, the response will indicate success.
{
"Request": "deleteMqttTopic",
"Status": "ok",
"StatusMessage": "The topic has been deleted successfully"
}
Request: Reflects back the original request type ("deleteMqttTopic").Status: The status of the request ("ok" for successful requests).Response: An object containing a confirmation message.If the request fails, an error response is returned.
{
"Request": "deleteMqttTopic",
"Status": "error",
"StatusMessage": "The \"topic\" parameter is missing"
}
{
"Request": "deleteMqttTopic",
"Status": "error",
"StatusMessage": "Error delete topic"
}
getMqttTopicList to see available topics before attempting to delete one.getMqttTopicListThe getMqttTopicList API retrieves a list of all configured MQTT topics and their configurations. This includes information about which requests are being published and at what intervals.
{
"Request": "getMqttTopicList",
"token": "userToken"
}
Request: The type of request, which is "getMqttTopicList" in this case.token (required): Authentication token for the session.The response contains all configured MQTT topics and their associated request configurations.
{
"Request": "getMqttTopicList",
"Status": "ok",
"Response": [
{
"Topic": "main",
"Requests": [
{
"Request": "getResults",
"Interval": 1000,
"startSync": 1
},
{
"Request": "getSpectrumResults",
"Interval": 5000,
"startSync": 60
}
]
},
{
"Topic": "deviceStatus",
"Requests": [
{
"Request": "getStatus",
"Interval": 15000,
"startSync": 1
}
]
}
]
}
Request: Reflects back the original request type ("getMqttTopicList").Status: The status of the request ("ok" for successful requests).Response: An object containing all configured MQTT topics:
[topic_name]: Each topic is represented by its name as a key:
Requests: An array of request objects configured for this topic:
Request: The type of request (e.g., "getResults", "getSpectrumResults").Interval: The interval in milliseconds (ms) at which the request is published.startSync: The sync alignment value in seconds as configured."main" topic if it exists.{}.deleteMqttTopic.subscribeChannelThe subscribeChannel API allows a WebSocket client to subscribe to a specific channel for receiving real-time data. This request can only be sent via WebSocket connection and enables the client to receive periodic updates from the specified channel.
Note: This request is WebSocket-only and cannot be sent via HTTP/TCP connections.
{
"Request": "subscribeChannel",
"Params": {
"channel": "main"
}
}
Request: The type of request, which is "subscribeChannel" in this case.Params: An object containing the parameters for the request.
channel (required): The name of the channel to subscribe to. If the specified channel doesn't exist, the client will be automatically subscribed to the "main" channel.If the subscription is successful, the response will indicate that the client has been subscribed to the specified channel.
{
"Request": "subscribeChannel",
"Status": "ok",
"Response": {
"message": "Subscribed to channel successfully"
}
}
Request: Reflects back the original request type ("subscribeChannel").Status: The status of the request ("ok" for successful requests).Response: An object containing the response data.
message: A message indicating that the subscription was successful.
{
"Request": "subscribeChannel",
"Status": "error",
"StatusMessage": "The "channel" parameter is missing"
}
{
"Request": "subscribeChannel",
"Status": "error",
"StatusMessage": "The channel doesn't exist. Subscribing to the 'main' channel."
}
8001 by default)."main" channel.getChannelList request.getChannelListThe getChannelList API retrieves a list of all available WebSocket channels and their configurations. This request can only be sent via WebSocket connection and returns information about all configured channels, including their associated requests and intervals.
Note: This request is WebSocket-only and cannot be sent via HTTP/TCP connections.
{
"Request": "getChannelList"
}
Request: The type of request, which is "getChannelList" in this case.The response contains all configured WebSocket channels and their associated request configurations.
{
"Request": "getChannelList",
"Status": "ok",
"Response": [
{
"Channel": "main",
"Requests": [
{
"Request": "getResults",
"Interval": 1000,
"startSync": 1
},
{
"Request": "getSpectrumResults",
"Interval": 5000,
"startSync": 60
}
]
},
{
"Channel": "deviceStatus",
"Requests": [
{
"Request": "getStatus",
"Interval": 15000,
"startSync": 1
}
]
}
]
}
Request: Reflects back the original request type ("getChannelList").Status: The status of the request ("ok" for successful requests).Response: An object containing all configured channels.
[channel_name]: Each channel is represented by its name as a key.
Requests: An array of request objects configured for this channel.
Request: The type of request (e.g., "getResults", "getSpectrumResults").Interval: The interval in milliseconds (ms) at which the request is sent.startSync: The sync alignment value in seconds as configured.8001 by default)."main" channel.{}.This configuration creates a new channel or updates an existing one with the specified requests and intervals.
deleteChannelThe deleteChannel API allows a WebSocket client to delete a specific channel and its associated configuration. This request can only be sent via WebSocket connection and permanently removes the channel from the system, including all its configured requests and intervals.
Note: This request is WebSocket-only and cannot be sent via HTTP/TCP connections.
{
"Request": "deleteChannel",
"Params": {
"channel": "main"
}
}
Request: The type of request, which is "deleteChannel" in this case.Params: An object containing the parameters for the request.
channel (required): The name of the channel to delete.If the channel is successfully deleted, the response will indicate that the channel has been removed from the system.
{
"Request": "deleteChannel",
"Status": "ok",
"StatusMessage": "The channel has been deleted successfully"
}
{
"Request": "deleteChannel",
"Status": "error",
"StatusMessage": "The "channel" parameter is missing"
}
{
"Request": "deleteChannel",
"Status": "error",
"StatusMessage": "Error, the channel doesn't exist!"
}
8001 by default).downloadFileStatus - WebSocket Message
The downloadFileStatus is a WebSocket message sent automatically by the server to clients subscribed to the
"UI" channel. This message provides real-time updates about the status of file downloads from devices to SvanLINK.
It is sent periodically during active downloads and when download status changes.
Note: This is a WebSocket message sent by the server, not a request that can be sent by clients.
{
"Request": "downloadFileStatus",
"Response": {
"serial": "3502",
"path": "/R41.WAV",
"size": 61536506,
"dateCreated": "2025-05-15 15:25:18",
"afdPath": "/path/to/afd/3502/R41_2025-05-15_15-25-18.WAV",
"status": "downloading",
"downloadedSize": 1605632
}
}
Request: Always "downloadFileStatus" for this message type.Response: An object containing the file download status information:
serial: Device serial number from which the file is being downloaded.path: Full file path on the device (e.g., "/R41.WAV").size: Total file size in bytes.dateCreated: File creation date/time on device (YYYY-MM-DD HH:mm:ss).afdPath: Full path where the file is being stored on SvanLINK.status: Current download status. Possible values:
"downloading" - File is currently being downloaded"current" - File is currently being processed"downloaded" - File successfully downloaded to SvanLINK"failed" - Download failed"deleted" - File has been deleted from SvanLINK"skipped" - File download was skippeddownloadedSize (optional): Number of bytes already downloaded. Only present when status is "downloading" or "current".dateDownloaded (optional): Date/time when file was downloaded to SvanLINK (YYYY-MM-DD HH:mm:ss). Only present when status is "downloaded".
To receive downloadFileStatus messages, clients must:
8001)."UI" channel using the channel subscription mechanism.
// JavaScript example
const ws = new WebSocket('ws://localhost:8001');
ws.onopen = () => {
// Send authentication token
ws.send('yourAuthToken');
// Subscribe to UI channel
ws.send(JSON.stringify({
"Channel": "UI",
"Requests": []
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.Request === 'downloadFileStatus') {
const file = data.Response;
console.log(`File: ${file.path}`);
console.log(`Status: ${file.status}`);
console.log(`Progress: ${file.downloadedSize}/${file.size} bytes`);
// Calculate download percentage
if (file.downloadedSize && file.size) {
const percentage = (file.downloadedSize / file.size * 100).toFixed(2);
console.log(`Download progress: ${percentage}%`);
}
}
};
downloadedSize and size to calculate download progress percentage."downloaded", the dateDownloaded field will be included."downloading" or "current" will include the downloadedSize field for progress tracking."UI" channel.