Skip to content

API Docs

Daniel edited this page May 28, 2022 · 3 revisions

This documentation contains all currently available query options as well as the resulting answers, which can currently be implemented via the interface of the API extension.

Connection test (api)

Request URL: "../index.php?controller=api&action=api"
Required Parameters: $_POST["client"], $_POST["secret"]
Response: string JSON { "valid": true, "response": "access granted" }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Version number (versionsGet)

Supported from version 1.0.14 of the extension API interface

Request URL: "../index.php?controller=api&action=versionsGet"
Required Parameters: $_POST["client"], $_POST["secret"]
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Get list of all webusers (usersGet)

Supported from version 0.0.3 of the extension API interface

Request URL: "../index.php?controller=api&action=usersGet"
Required Parameters: $_POST["client"], $_POST["secret"]
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Retrieve webuser data (userGet)

Request URL: "../index.php?controller=api&action=userGet"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*user-id*/
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Find webuser by username (userFindByUsername)

Supported from version 0.0.3 of the extension API interface

Request URL: "../index.php?controller=api&action=userFindByUsername"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["username"]
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Find a webuser based on the email address (userFindByEmail)

Supported from version 0.0.3 of the extension API interface

Request URL: "../index.php?controller=api&action=userFindByEmail"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["email"]
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Add webuser (userAdd)

Request URL: "../index.php?controller=api&action=userAdd"
Required Parameters: $_POST["client"], $_POST["secret"], Array ( $_POST["data"] => Array ( ["username"], ["group_id"], ["init_pw"], ["first_name"], ["last_name"], ["email"], ["lang"], ["fixed_virtual_servers"] => Array ( int 'INSTANCE-ID' => Array ( int 'VIRTUAL-SERVER-ID', int 'VIRTUAL-SERVER-ID', ... ) ) ) )
Response: string JSON { "valid": true, "response": "NEW USER-ID" }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Modify webuser (userModify)

Supported from version 0.0.10 of the extension API interface

Request URL: "../index.php?controller=api&action=userModify"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*user-id*/
Optional Parameters: Array ( $_POST["data"] => Array ( ["username"], ["group_id"], ["init_pw"], ["first_name"], ["last_name"], ["email"], ["lang"], ["fixed_virtual_servers"] => Array ( int 'INSTANCE-ID' => Array ( int 'VIRTUAL-SERVER-ID', int 'VIRTUAL-SERVER-ID', ... ) ) ) )
Response: string JSON { "valid": true }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Delete webuser (userDel)

Request URL: "../index.php?controller=api&action=userDel"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*user-id*/
Response: string JSON { "valid": true }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Get permission role list (rolesGet)

Supported from version 0.0.3 of the extension API interface

Request URL: "../index.php?controller=api&action=rolesGet"
Required Parameters: $_POST["client"], $_POST["secret"]
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Get permission role data (roleGet)

Request URL: "../index.php?controller=api&action=roleGet"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*role-id*/
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Find permission role by name (roleFindByName)

Supported from version 0.0.3 of the extension API interface

Request URL: "../index.php?controller=api&action=roleFindByName"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["name"]
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Delete permission role (roleDel)

Supported from version 0.0.3 of the extension API interface

Request URL: "../index.php?controller=api&action=roleDel"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*role-id*/
Response: string JSON { "valid": true }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Get an instance list (instancesGet)

Supported from version 0.0.3 of the extension API interface

Request URL: "../index.php?controller=api&action=instancesGet"
Required Parameters: $_POST["client"], $_POST["secret"]
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Retrieve instance data (instanceGet)

Request URL: "../index.php?controller=api&action=instanceGet"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Instance based on the IP find (instanceFindByIp)

Supported from version 0.0.3 of the extension API interface

Request URL: "../index.php?controller=api&action=instanceFindByIp"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["ip"]
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Delete instance (instanceDel)

Supported from version 0.0.3 of the extension API interface

Request URL: "../index.php?controller=api&action=instanceDel"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/
Response: string JSON { "valid": true }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Get list of virtual servers of an instance (instanceGetServerList)

Supported from version 0.0.8 of the extension API interface

Request URL: "../index.php?controller=api&action=instanceGetServerList"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Retrieve data from a virtual server (vServerGet)

Supported from version 0.0.9 of the extension API interface

Request URL: "../index.php?controller=api&action=vServerGet"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/, 
$_POST["sid"] /*virtual server id*/
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Create a virtual server (vServerCreate)

Supported from version 0.0.9 of the extension API interface

Request URL: "../index.php?controller=api&action=vServerCreate"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/
Optional Parameters: $_POST["properties"] /*server properties*/
Response: string JSON { "valid": true, "response": "NEW VIRTUALSERVER-ID" }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Change virtual server (vServerModify)

Supported from version 0.0.9 of the extension API interface

Request URL: "../index.php?controller=api&action=vServerModify"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/, $_POST["sid"] /*virtual server id*/
$_POST["properties"] /*server properties*/
Response: string JSON { "valid": true }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Delete virtual server (vServerDelete)

Supported from version 0.0.9 of the extension API interface

Request URL: "../index.php?controller=api&action=vServerDelete"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/, 
$_POST["sid"] /*virtualserver id*/
Response: string JSON { "valid": true }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Start virtual server (vServerStart)

Supported from version 0.0.9 of the extension API interface

Request URL: "../index.php?controller=api&action=vServerStart"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/, 
$_POST["sid"] /*virtualserver id*/
Response: string JSON { "valid": true }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Stop virtual server (vServerStop)

Supported from version 0.0.9 of the extension API interface

Request URL: "../index.php?controller=api&action=vServerStop"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/, 
$_POST["sid"] /*virtualserver id*/
Response: string JSON { "valid": true }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Get Teamspeak Viewer (vServerViewGet)

Supported from version 0.0.7 of the extension API interface

Request URL: "../index.php?controller=api&action=vServerViewGet"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/ , 
$_POST["sid"] /*virtual server id*/
Optional Parameters: $_POST["flags"] = true /*Displays the country flags of the respective clients*/, 
$_POST["style"] = "old" /*Shows the viewer in the usual TS3 style*/
$_POST["exclude_query_clients"] = false /* false: Show Query Clients | true: Hide Query Clients
$_POST["format"] = "" /* "json": Response in the form of a JSON structure that is similar to the structure provided by the Planet TeamSpeak Simple REST (server-mode) API and is fully compatible with the jquery-ts3viewer plug-in
Response: string JSON { "valid": true, "response": string JSON { DATA } }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Cronjobs work off (runCron)

Supported from version 1.0.5 of the extension API interface

Request URL: "../index.php?controller=api&action=runCron"
Response: string JSON { "valid": true, "response": "MICROTIME" }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Check if Simple Bot is active (simpleBotIsRunning)

Supported from version 1.0.6 of the extension API interface and only in conjunction with the extension module Simple Bots

Request URL: "../index.php?controller=api&action=simpleBotIsRunning"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/, 
$_POST["sid"] /*virtualserver id*/
Response: string JSON { "valid": true, "response": "CURRENT BOT UID" }
Error: string JSON { "valid": false, "error": "MESSAGE || (BOOL) FALSE" }

Start Simple Bot (simpleBotRun)

Supported from version 1.0.6 of the extension API interface and only in conjunction with the extension module Simple Bots

Request URL: "../index.php?controller=api&action=simpleBotRun"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/, 
$_POST["sid"] /*virtualserver id*/
Optional Parameters: $_POST["lang"] /*de_DE, en_GB*/, 
$_POST["sid"] /*virtualserver id*/
Response: string JSON { "valid": true, "response": "CURRENT BOT UID" }
Error: string JSON { "valid": false, "error": "MESSAGE" }

Stop Simple Bot (simpleBotStop)

Supported from version 1.0.6 of the extension API interface and only in conjunction with the extension module Simple Bots

Request URL: "../index.php?controller=api&action=simpleBotStop"
Required Parameters: $_POST["client"], $_POST["secret"], $_POST["id"] /*instance-id*/, 
$_POST["sid"] /*virtualserver id*/
Response: string JSON { "valid": true }
Error: string JSON { "valid": false, "error": "MESSAGE" }