TeamSpeak Remote Apps

Since some people have had problems with the remote apps up to now, I wanted to show an example including the code.

Request an API Key:

{
  "type": "auth",
	"payload": {
				"identifier": "de.bytestore",
				"version": "0",
				"name": "Example",
				"description": "Description of your App.",
				"content": {
					"apiKey": ""
			}
  }
}

If you send this Request to your Client (WebSocket Server) than you should get following Response on Accept the Request:

{
   "payload":{
      "apiKey":"e4f1bc71-bd45-46fc-b523-b44fe5c4a2e7",
      "connections":[
         
      ],
      "currentConnectionId":0
   },
   "status":{
      "code":0,
      "message":"ok"
   },
   "type":"auth"
}

Now some Code examples:

// WebSocket Client Endpoint in JavaScript
 
var ws = new WebSocket("ws://localhost:5899");
 
// Event handler for the WebSocket connection opening
ws.onopen = (event) => {
   ws.send("connected")
};
 
// Event handler for receiving text messages
ws.onmessage = (event) => {
      console.log(event.data)
}
 
// Event handler for errors in the WebSocket object
ws.onerror = (err) => {
   console.log("Error ", err);
};
 
// Listen for the close connection event
 ws.onclose = (event) => {
   console.log("Disconnected: " + event.reason);
}
 
// Send the message
ws.send({
         "type": "auth",
         "payload": {
             "identifier": "de.teamspeak",
             "version": "0",
             "name": "DISPLAY NAME",
             "description": "Some description",
             "content": {
                 "apiKey": ""
           }
      }
});
 
ws.close();

Hotkeys in (5.0.0-beta55)
You now have your API Key and your Open Stream, lets start by the first Action wich was implemented at 02.06.2021 on the Beta Clients.

You can simply create your “own” Button by following Request:

{
   "type":"buttonPress",
   "payload":{
      "button":"de.bytestore.key1",
      "state":true
   }
}

de.bytestore can be your Application identification.
key1 can be your Key identification.

For setting up now your custom Keybind, you can Navigate into your Settings and as you set a normal Keybind you can setup your Key via the Remote App in following Steps:

YOU SHOULD EXECUTE THE REQUEST TWICE (Like a real Button):

  1. Button Enable
  2. Button Disable

Other Examples, will follow if TeamSpeak publish more Information.

Best Regards
Jan

4 Likes

Hey there! Nice writeup.
I have written a library in go that supports (ATM) sending the auth-event and the buttonPress-event …
and receiving much more (auth, clientSelfPropertyUpdated, clientPropertiesUpdated, connectStatusChanged, channelsSubscribed, clientMoved, channelPropertiesUpdated, clientChannelGroupChanged, channels, groupInfo, permissionList, serverPropertiesUpdated, neededPermissions, buttonPress).

That are all the events I could find during development. If you encounter different ones please send payloads and names :slight_smile:

btw… contributions are welcome!

1 Like
twitch instagram twitter facebook