2019-01-15 00:46:39 +00:00
|
|
|
# go-tsviewer **[WIP]**
|
|
|
|
## **WARNING** This API is not usable ATM
|
|
|
|
|
|
|
|
A REST API made for TS3 Viewer.
|
|
|
|
|
|
|
|
# Features
|
|
|
|
## Config
|
|
|
|
The config file is generated automatically on first startup.
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"ip": "127.0.0.1", // Server IP
|
|
|
|
"port": 10011, // Dataquery Port
|
|
|
|
"user": {
|
|
|
|
"name": "serveradmin", // Username
|
|
|
|
"password": "" // Password
|
|
|
|
},
|
|
|
|
"server": {
|
|
|
|
"port": 9987 // Port of the target server
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
## URL-Parameter
|
|
|
|
| Name | Type | Description |
|
|
|
|
| ---------- | -------- | ------------------------ |
|
|
|
|
| `pretty` | `bool` | pretty-prints JSON |
|
|
|
|
| `envelope` | `bool` | wraps JSON in data array |
|
|
|
|
## Channels
|
|
|
|
- **`GET`** `/v1/channels/:id`
|
|
|
|
- **`GET`** `/v1/channels`
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"id": 1,
|
|
|
|
"databaseId": 1,
|
|
|
|
"nickname": "serveradmin from 127.0.0.1:58359",
|
|
|
|
"type": 1,
|
|
|
|
"away": false,
|
|
|
|
"awayMessage": ""
|
|
|
|
}
|
|
|
|
```
|
|
|
|
## Clients
|
|
|
|
- **`GET`** `/v1/clients/:id`
|
|
|
|
- **`GET`** `/v1/clients/`
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"id": 1,
|
|
|
|
"subchannels": [
|
|
|
|
... (contains all subchannel)
|
|
|
|
],
|
|
|
|
"name": "main1",
|
|
|
|
"totalClients": 0,
|
|
|
|
"neededSubscribePower": 0
|
|
|
|
},
|
|
|
|
```
|