WebQuery discussion/help (3.12.0 onwards)

Is someone else here feeling the same thing I reported here?:
https://community.teamspeak.com/t/teamspeak-server-3-12-x/3916/86?u=varredor

Cheers

Long time waited for this kind of WebQuery! Thx for implementing! :slight_smile:

IĀ“m already on transporting my old classes to the new Webquery and it just works fine. But there is one question that came in my mind while I was programming: Can I implement the new solution of my programs in production system of my services? Or is there any chance, that the WebQuery will change completely in the future and it would be a better idea to wait?

Regards,

Barny

I wanna list all clients (online+offline) with the new api. Im currently using ā€˜clientdblistā€™ but I only get like 20+ results instead of 100+

'http://${benderServer}/${benderServerID}/clientdblist?api-key=${benderAPIKey}'

Is there a different command or am I using the current one wrong?

1 Like

I added duration and now i receive hundreds of clients nice! thanks!

2 Likes

Iā€™m currently working on a bot which requests>600 api calls in few seconds. (Few times a day)
After some few requests in a second my ip gets blocked from teamspeak, so i canā€™t request data from the api for some time.

I already tried to enter my ip in the var/ts3server/query_ip_whitelist.txt + higher the amount in the anti-flood tab in the server settings which has not worked for me.

1 Like

What flood settings are you using?

image

Btw. I just created the whitelist file (var/ts3server/query_ip_whitelist.txt) without using the environment variable (TS3SERVER_IP_WHITELIST), is that right?

Flood:Well, youā€™d want to raise that points per tick reduction by a lot - as it is, itā€™ll take a while to get to 10000 points, but itā€™d decay very very slowly ā€¦ BUT the ip_whitelist should avoid the need for this anyway :slight_smile:

i think the query whitelist defaults to query_ip_whitelist.txt in the launch folder, but Iā€™d try setting it to /var/ts3server/query_ip_whitelist.txt to be sure (donā€™t have it handy to double check, sorry)

2 Likes

I placed the whitelist file outside of the container it was my fault :confused:
now It works fine

2 Likes

:slight_smile: you arenā€™t the first, glad it works now!

3 Likes

Is there any consideration to change the API to a more RESTful (-like) approach? Iā€™m happy the way it is right now too but in the past few months working with REST-APIs the URL representation really grew on me. This could eliminate the discussion whether the endpoint returns an array or single item.

Some examples could be:

  • version (maybe even more info)
    GET /

  • channellist / channelfind
    GET /servers/{id}/channels?channel_name={name}

  • channelcreate
    POST /servers/{id}/channels

  • channeledit
    PUT/PATCH /servers/{id}/channels/{id}

  • channeldelete
    DELETE /servers/{id}/channels/{id}

  • channelinfo
    GET /servers/{id}/channels/{id}

  • servergroupaddclient
    This is actually kinda tricky.
    POST /servers/{id}/groups/{id}/clients/
    body: {ā€œclient_idā€: id}
    (maybe?)

  • serverstart / serverstop
    A little tricky as well
    PUT /server/{id}/status
    body: {ā€œstatusā€: ā€œstarted|stoppedā€}

I donā€™t know if my suggestion makes sense at all. I personally find it pretty intuitive after a while, especially because many of the commands are working on entities (REST: resources). But I also understand that the current way replicates the old query commands and that priorities are probably on much more important things.
Or maybe itā€™s even just me who thinks like this ĀÆ\_(惄)_/ĀÆ

Have thought about that too, and for certain queries it could work quite elegantly. Could be an option one day, but no immediate plans :slight_smile:

2 Likes

MYIP:10080/3/clientdblist?duration=9999999

I ā€œonlyā€ receive exactly 200 clients but we have bit more clients. Is there a way to get them?

1 Like

wow thanks for the quick reply! Tried few values(200,500,3000,ā€¦) but max. i get 200 clients :confused:

Usage: banlist [start={offset}] [duration={limit}] [-count] use start to skip over n entries, and if you want to know the total amount of possible values add -count.

So the first call would be [..]/banlist?-count&start=0&duration=200, followed by [..]/banlist?start=200&duration=200, etcā€¦

3 Likes

Hm okay, but thatā€™s quite annoying & not that performant imo.

For example if i got 2000 clients I need to call the clientdblist 10x. One call with duration 2000 would be better for developing & more performant.

So i guess i need to call the clientdblist multiple times :confused:
It would be nice if the API getā€™s an update with unlimited individual duration values :pleading_face:

hello, I am currently working on query_http and have read a little about it
Linux command: curl -H ā€˜x-api-key: ******************************ā€™ 'http: //000.000 .000.000: 10080 / gm? Msg = test + MSG ā€™

now i thought to myself that you can surely do it via a browser and found that only an error message is displayed.

{ā€œstatusā€: {ā€œcodeā€: 5124, ā€œmessageā€: ā€œmissing apikeyā€}}

My questions are:

  1. can you use the api key via the browser?
  2. can I control the query_http via php? if so, i would need a little nudge

link and tips are welcome

how can I assign/remove multiple groups from a client with one call?

let groups=await axios.get(`http://${this.server}/${this.server_id}/servergroupaddclient`, {
          params: {
            'api-key': this.api_key,
            'sgid': benderVeteranLevel1.groupID,
            'cldbid': clbid
          }
        });
1 Like

Itā€™s been a few months, is there any way to disconnect WebQuery-Clients? I hate the idea of timeouts aswell.

What do you mean? The query client doesnā€™t stay connected on itā€™s own. You must have done something.