🖥️
TSManage Docs
  • 👋Introduction
    • 🎉Welcome to TSManage
    • 🙋‍♂️Support
  • 💻Setup
    • ✨Initial Server Setup
  • 🚁Platform
    • 🌐Public API
Powered by GitBook
On this page
  • Required Permissions
  • Creating API Keys
  • Basic Usage
  • Authentication
  • Endpoints
  • Retrieve bulk TeamSpeak server member information by client unique identifiers
  • Bulk update server groups of TeamSpeak server members by client unique identifiers and server group IDs
  1. Platform

Public API

TSManage provides a public API for integrating its core management features with third-party apps and IoT devices.

PreviousInitial Server Setup

Last updated 1 year ago

When you make a request to TSManage using your API key, it's as though you are logged in and taking actions directly within the Management UI.

Required Permissions

Grant users a role with the "Manage API Keys" permission.

Once assigned, users can generate their own API keys.

Creating API Keys

Creating an API key is straightforward. Users will be shown their new API key once and must save it immediately, as it won't be retrievable later.

Basic Usage

Base URL: https://demo.tsmanage.com/public-api/v0/

The following headers are required in every request:

  1. Content-Type: application/json

  2. Accept: application/json

Authentication

Follows RFC 6750 standards, using the API key as the bearer token for authentication.

Endpoints

Retrieve bulk TeamSpeak server member information by client unique identifiers

Example usage to return info on two members:

GET /members?id=XXXXX=&id=YYYYY=

Returns:

[
    {
        "cldbid": 1,
        "clientUniqueIdentifier": "XXXXX=",
        "clientNickname": "John D. 1A-23",
        "clientCreated": 1234567890,
        "clientLastconnected": 2345678901,
        "clientTotalconnections": 150,
        "serverGroups": [
            {
                "name": "Police Department",
                "sgid": 123
            },
            {
                "name": "Fire Department",
                "sgid": 456
            }
        ]
    },
    {
        "cldbid": 2,
        "clientUniqueIdentifier": "YYYYY=",
        "clientNickname": "Jane D. 2B-45",
        "clientCreated": 1234567890,
        "clientLastconnected": 2345678901,
        "clientTotalconnections": 300,
        "serverGroups": [
            {
                "name": "1 Year of Service",
                "sgid": 789
            }
        ]
    }
]

Bulk update server groups of TeamSpeak server members by client unique identifiers and server group IDs

Example usage to add and remove some server groups from three members:

PATCH /members/update-batch

Expects a body in the following schema:

{
    memberIds: {type: "array", items: {type: "string"}},
    serverGroupIdsToAdd: {type: "array", items: {type: "integer"}},
    serverGroupIdsToRemove: {type: "array", items: {type: "integer"}}
}

Returns a result object with three properties: addedGroups, removedGroups, members. The added and removed groups keys contain the fully-resolved groups represented by the IDs originally passed into the serverGroupIdsToAdd and serverGroupIdsToRemove fields respectively. The members key contains an array of members that were affected by the request, with each member's new groups after the change.

Full working example:

PATCH /public-api/v0/members/update-batch HTTP/1.1
Host: demo.tsmanage.com
Accept: application/json
Content-Type: application/json
Authorization: Bearer bbee15c15edff195727da659e607202913c2ff765fb44cb9734ee8be0f4152d7
Content-Length: 121

{
    "memberIds": ["XXXXX=", "YYYYY="],
    "serverGroupIdsToAdd": [123],
    "serverGroupIdsToRemove": [456, 789]
}

Response example:

{
    "addedGroups": [
        {
            "sgid": "123",
            "name": "Sheriff's Office",
            "type": 1,
            "iconid": "123123123",
            "savedb": 1,
            "sortid": "123",
            "namemode": 0,
            "nModifyp": 1,
            "nMemberAddp": 2,
            "nMemberRemovep": 3,
            "_namespace": "servergroup"
        }
    ],
    "removedGroups": [
        {
            "sgid": "456",
            "name": "5 Years of Service",
            "type": 1,
            "iconid": "123123123",
            "savedb": 1,
            "sortid": "123",
            "namemode": 0,
            "nModifyp": 1,
            "nMemberAddp": 2,
            "nMemberRemovep": 3,
            "_namespace": "servergroup"
        },
        {
            "sgid": "789",
            "name": "Retired Fire Chief",
            "type": 1,
            "iconid": "123123123",
            "savedb": 1,
            "sortid": "123",
            "namemode": 1,
            "nModifyp": 1,
            "nMemberAddp": 2,
            "nMemberRemovep": 3,
            "_namespace": "servergroup"
        }
    ],
    "members": [
        {
            "cldbid": 1,
            "clientUniqueIdentifier": "XXXXX=",
            "clientNickname": "John D. 1A-23",
            "clientCreated": 1234567890,
            "clientLastconnected": 2345678901,
            "clientTotalconnections": 150,
            "serverGroups": [
                // Note that sheriff's office has been added
                {
                    "name": "Sheriff's Office",
                    "sgid": 123
                },
                {
                    "name": "Fire Department",
                    "sgid": 9999
                }
            ]
        },
        {
            "cldbid": 2,
            "clientUniqueIdentifier": "YYYYY=",
            "clientNickname": "Jane D. 2B-45",
            "clientCreated": 1234567890,
            "clientLastconnected": 2345678901,
            "clientTotalconnections": 300,
            "serverGroups": [
                // Note that sheriff's office has been added
                {
                    "name": "Sheriff's Office",
                    "sgid": 123
                },
                {
                    "name": "Highway Patrol",
                    "sgid": 123123
                },
                {
                    "name": "Retired Commissioner",
                    "sgid": 456456456
                }
            ]
        }
    ]
}
🚁
🌐
The permission necessary to manage the user's API keys
How to access the API settings in order to create API keys
Example API key creation