Communication Protocol
The default TCP port is 8001. Set it with --port, TESSONICS_SRS_SERVER_PORT, or server.port. End each JSON request and response with a zero byte (\x00). A connection can carry multiple exchanges.
If you are new to the API, start with the SRS API guide. This page explains how to frame packets, choose a request, and interpret the response.
1. Send a request packet
Every request is a JSON object. The top-level key tells the SRS system what to do:
{"get":"<resource>"}
Use get to query information or request an acquisition. Add a payload when needed. version-info and hardware-info need none. acq needs acquisition details.
{"put":"<resource>","payload":{}}
Use put to update configuration or templates.
Terminate each request with a zero byte (\x00). The notation below shows one complete request packet. Send the \x00 byte after the closing brace. It is not part of the JSON text.
{"get":"version-info"}\x00
2. Read one response packet
Read the TCP stream until the next zero byte. The bytes before it form one JSON response. A successful response usually has a type and a payload:
{"type":"version-info","payload":{"semantic":"...","githash":"...","timestamp":"..."}}
The response type identifies its payload. get acq returns measurement-info. Successful put requests return status with payload ok. See the API reference for response fields.
After reading a complete response, reuse the connection for the next request and response.
3. Choose a resource
| Request | Payload | Successful response |
|---|---|---|
get version-info | None | version-info (VERSION-INFO) |
get hardware-info | None | hardware-info (HARDWARE-INFO) |
get config | None | config (Auditor Config) |
get config-schema | None | JSON schema for Auditor Config |
get acq-config | None | acq-config (Acquire Config) |
get acq-config-schema | None | Current acquisition configuration JSON schema |
get acq-test | Acquisition settings object in payload | measurement-data with uid, timestamp, and btdm_z_b64 |
get acq | Acquire Request | measurement-info (Measurement Info) |
get recent-measurements | Filter object with optional earliest, limit, and offset | measurements array |
get measurement | Object containing the measurement uid | measurement when the UID is found |
get templates | None | templates (Template Info) |
get templates-schema | None | JSON schema for Template Info |
put config | Auditor configuration object | status with payload ok |
put acq-config | Complete Acquire Config | status with payload ok |
put templates | Template Info object | status with payload ok |
get measurement and get recent-measurements require storage. See Obtaining Measurements or Managing Measurement History.
get acq-test performs an acquisition with payload settings applied to the current config. It saves the result as acq-test when storage is available.
Errors
If a request cannot be handled, the SRS system can return an error response instead of the expected success response:
{
"type": "error",
"payload": {
"code": 2,
"message": "syntax",
"detail": "Optional additional information"
}
}
detail is optional. The documented codes are:
| Code | Message | Meaning |
|---|---|---|
| 1 | system | A system-level error occurred. |
| 2 | syntax | The request is not valid JSON or does not follow the request format. |
| 3 | content | The request content is invalid or a required field is missing. |
| 4 | part-id | The acq request is missing a part ID. This error is not active yet. |
| 5 | location-id | The acq request is missing a location ID. This error is not active yet. |
Send valid JSON packets without comments or trailing commas.