Discuss the new HTTP query method here:
Click here to see a mini tutorial about WebQuery .
How to use:
- start ts3server with WebQuery enabled
./ts3server query_protocols=raw,ssh,http,https
- create a universal API key. (
BAByFoiEXZfnSJyE6dbXFiW_nn_SdwkclpKNz9j
in the example)$ nc -q1 localhost 10011 <<EOF login serveradmin password apikeyadd scope=manage lifetime=0 EOF
TS3 Welcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command. error id=0 msg=ok apikey=BAByFoiEXZfnSJyE6dbXFiW_nn_SdwkclpKNz9j id=4 sid=0 cldbid=1 scope=manage time_left=unlimited created_at=1582102492 expires_at=1582102492 error id=0 msg=ok
- testing the API key
$ curl -H 'x-api-key: BAByFoiEXZfnSJyE6dbXFiW_nn_SdwkclpKNz9j' 'http://127.0.0.1:10080/gm?msg=Hello+World'
{"status":{"code":0,"message":"ok"}}
$ curl -H 'x-api-key: BAByFoiEXZfnSJyE6dbXFiW_nn_SdwkclpKNz9j' 'http://127.0.0.1:10080/1/channellist?-topic&-icon'
{"body":[{"channel_icon_id":"0","channel_name":"Default Channel","channel_needed_subscribe_power":"0","channel_order":"0","channel_topic":"Default Channel has no topic","cid":"1","pid":"0","total_clients":"1"}],"status":{"code":0,"message":"ok"}}
Here is an overview for the scopes and the commands that can be used with these scopes
{ "apikeyadd", { manage_scope, } },
{ "apikeydel", { manage_scope, } },
{ "apikeylist", { manage_scope, } },
{ "banadd", { manage_scope, write_scope, } },
{ "banclient", { manage_scope, write_scope, } },
{ "bandel", { manage_scope, write_scope, } },
{ "bandelall", { manage_scope, write_scope, } },
{ "banlist", { manage_scope, write_scope, read_scope, } },
{ "bindinglist", { manage_scope, read_scope } },
{ "channeladdperm", { manage_scope, } },
{ "channelclientaddperm", { manage_scope, } },
{ "channelclientdelperm", { manage_scope, } },
{ "channelclientpermlist", { manage_scope, write_scope, read_scope, } },
{ "channelcreate", { manage_scope, write_scope, } },
{ "channeldelete", { manage_scope, write_scope, } },
{ "channeldelperm", { manage_scope, } },
{ "channeledit", { manage_scope, write_scope, } },
{ "channelfind", { manage_scope, write_scope, read_scope, } },
{ "channelgroupadd", { manage_scope, write_scope, } },
{ "channelgroupaddperm", { manage_scope, } },
{ "channelgroupclientlist", { manage_scope, write_scope, read_scope, } },
{ "channelgroupcopy", { manage_scope, } },
{ "channelgroupdel", { manage_scope, } },
{ "channelgroupdelperm", { manage_scope, } },
{ "channelgrouplist", { manage_scope, write_scope, read_scope, } },
{ "channelgrouppermlist", { manage_scope, write_scope, read_scope, } },
{ "channelgrouprename", { manage_scope, } },
{ "channelinfo", { manage_scope, write_scope, read_scope, } },
{ "channellist", { manage_scope, write_scope, read_scope, } },
{ "channelmove", { manage_scope, write_scope, } },
{ "channelpermlist", { manage_scope, write_scope, read_scope, } },
{ "clientaddperm", { manage_scope, } },
{ "clientdbdelete", { manage_scope, write_scope, } },
{ "clientdbedit", { manage_scope, write_scope, } },
{ "clientdbfind", { manage_scope, write_scope, read_scope, } },
{ "clientdbinfo", { manage_scope, write_scope, read_scope, } },
{ "clientdblist", { manage_scope, write_scope, read_scope, } },
{ "clientdelperm", { manage_scope, } },
{ "clientedit", { manage_scope, write_scope, } },
{ "clientfind", { manage_scope, write_scope, read_scope, } },
{ "clientgetdbidfromuid", { manage_scope, write_scope, read_scope, } },
{ "clientgetids", { manage_scope, write_scope, read_scope, } },
{ "clientgetnamefromdbid", { manage_scope, write_scope, read_scope, } },
{ "clientgetnamefromuid", { manage_scope, write_scope, read_scope,} },
{ "clientgetuidfromclid", { manage_scope, write_scope, read_scope, } },
{ "clientinfo", { manage_scope, write_scope, read_scope, } },
{ "clientkick", { manage_scope, write_scope, } },
{ "clientlist", { manage_scope, write_scope, read_scope, } },
{ "clientmove", { manage_scope, write_scope, } },
{ "clientpermlist", { manage_scope, write_scope, read_scope, } },
{ "clientpoke", { manage_scope, write_scope, } },
{ "clientsetserverquerylogin", { manage_scope, write_scope, } },
{ "clientupdate", { manage_scope, write_scope, } },
{ "complainadd", { manage_scope, write_scope, } },
{ "complaindel", { manage_scope, write_scope, } },
{ "complaindelall", { manage_scope, write_scope, } },
{ "complainlist", { manage_scope, write_scope, read_scope, } },
{ "custominfo", { manage_scope, write_scope, read_scope, } },
{ "customsearch", { manage_scope, write_scope, read_scope, } },
{ "customset", { manage_scope, write_scope, } },
{ "customdelete", { manage_scope, write_scope, } },
{ "ftcreatedir", not_supported },
{ "ftdeletefile", not_supported },
{ "ftgetfileinfo", not_supported },
{ "ftgetfilelist", not_supported },
{ "ftinitdownload", not_supported },
{ "ftinitupload", not_supported },
{ "ftlist", not_supported },
{ "ftrenamefile", not_supported },
{ "ftstop", not_supported },
{ "gm", { manage_scope, } },
{ "help", { manage_scope, write_scope, read_scope, } },
{ "hostinfo", { manage_scope, write_scope, read_scope, } },
{ "instanceedit", { manage_scope, } },
{ "instanceinfo", { manage_scope, write_scope, read_scope, } },
{ "logadd", { manage_scope, write_scope, } },
{ "login", not_supported },
{ "logout", not_supported },
{ "logview", { manage_scope, write_scope, read_scope, } },
{ "messageadd", { manage_scope, write_scope, } },
{ "messagedel", { manage_scope, write_scope, } },
{ "messageget", { manage_scope, write_scope, read_scope, } },
{ "messagelist", { manage_scope, write_scope, read_scope, } },
{ "messageupdateflag", { manage_scope, write_scope, } },
{ "permfind", { manage_scope, write_scope, read_scope, } },
{ "permget", { manage_scope, write_scope, read_scope, } },
{ "permidgetbyname", { manage_scope, write_scope, read_scope, } },
{ "permissionlist", { manage_scope, write_scope, read_scope, } },
{ "permoverview", { manage_scope, write_scope, read_scope, } },
{ "permreset", { manage_scope, } },
{ "privilegekeyadd", { manage_scope, write_scope, } },
{ "privilegekeydelete", { manage_scope, write_scope, } },
{ "privilegekeylist", { manage_scope, write_scope, read_scope, } },
{ "privilegekeyuse", { manage_scope, write_scope, } },
{ "queryloginadd", { manage_scope, write_scope, } },
{ "querylogindel", { manage_scope, write_scope, } },
{ "queryloginlist", { manage_scope, write_scope, read_scope } },
{ "quit", not_supported },
{ "sendtextmessage", { manage_scope, write_scope, } },
{ "servercreate", { manage_scope, } },
{ "serverdelete", { manage_scope, } },
{ "serveredit", { manage_scope, write_scope, } },
{ "servergroupadd", { manage_scope, } },
{ "servergroupaddclient", { manage_scope, } },
{ "servergroupaddperm", { manage_scope, } },
{ "servergroupautoaddperm", { manage_scope, } },
{ "servergroupautodelperm", { manage_scope, } },
{ "servergroupclientlist", { manage_scope, } },
{ "servergroupcopy", { manage_scope, } },
{ "servergroupdel", { manage_scope, } },
{ "servergroupdelclient", { manage_scope, } },
{ "servergroupdelperm", { manage_scope, } },
{ "servergrouplist", { manage_scope, } },
{ "servergrouppermlist", { manage_scope, } },
{ "servergrouprename", { manage_scope, } },
{ "servergroupsbyclientid", { manage_scope, } },
{ "serveridgetbyport", { manage_scope, } },
{ "serverinfo", { manage_scope, } },
{ "serverlist", { manage_scope, } },
{ "servernotifyregister", not_supported },
{ "servernotifyunregister", not_supported },
{ "serverprocessstop", { manage_scope, } },
{ "serverrequestconnectioninfo", { manage_scope, write_scope, read_scope, } },
{ "serversnapshotcreate", { manage_scope, } },
{ "serversnapshotdeploy", { manage_scope, } },
{ "serverstart", { manage_scope, } },
{ "serverstop", { manage_scope, } },
{ "servertemppasswordadd", { manage_scope, write_scope, } },
{ "servertemppassworddel", { manage_scope, write_scope, } },
{ "servertemppasswordlist", { manage_scope, write_scope, read_scope, } },
{ "setclientchannelgroup", { manage_scope, write_scope, } },
{ "tokenadd", { manage_scope, write_scope, } },
{ "tokendelete", { manage_scope, write_scope, } },
{ "tokenlist", { manage_scope, write_scope, read_scope, } },
{ "tokenuse", { manage_scope, write_scope, } },
{ "use", not_supported },
{ "version", { manage_scope, write_scope, read_scope, } },
{ "whoami", { manage_scope, write_scope, read_scope, } },
[details = Here’s how to use the native HTTPS support]
These parameters are needed to enable the feature.
And you must add your own .pem files to make it work.
query_protocols=https
query_https_ip=0.0.0.0,::
query_https_port=10443
query_https_certificate_file=your_cert.pem
query_https_private_key_file=your_key.pem
This command can be used to create a own certification on Linux .
openssl req -x509 -newkey rsa:4096 -nodes -keyout key.pem -out cert.pem -days 365
[/details]