WebQuery discussion/help (3.12.0 onwards)

serversnapshotdeploy [-mapping] [-keepfiles] [password=secret] virtualserver_snapshot

How can i pass fields like -mapping and -keepfiles for a http request?

1 Like

From memory, something like:

serversnapshotdeploy?-mapping&-keepfiles

(etc)

3 Likes

Wait… what?? I have to update my parser… wouldn´t it be better to pass booleans?

1 Like

I think the intent here was compatibility with the existing query methods.

2 Likes

@davinciTS Will it also understand serversnapshotdeploy?-mapping= ?

Edit: It understands -mapping=true

I wanna use WebQuery with docker, but i got no idea how to start. A small introduction would be nice.

Sure, you can do that. Set TS3SERVER_QUERY_PROTOCOLS (ie with -e) to include HTTP, something like (completely untested, just to get you started):

docker run -p 10080:10080 -e TS3SERVER_LICENSE=accept -e TS3SERVER_QUERY_PROTOCOLS=http teamspeak

2 Likes

Thanks for the quick help!

How do i generate an api key?
Do I need to generate it by my own? If so what’s the length/characters?

In ServerQuery you perform the apikeyadd command to generate one or you start a server for the first time.
Send command help apikeyadd to get more details about the usage.

2 Likes

Thanks again :smiling_face_with_three_hearts:
How do I communicate on docker with ./ts3server ?

I’m not quite sure what you mean, sorry - what are you trying to do? :slight_smile:

1 Like

I just have setup the container and can communicate with the api. (Image postman)

But on this part just nothing happens:

Hmm, check the docker logs, make sure you enabled raw query too in the docker for your nc: -p 10011:10011 -p 10080:10080 -e TS3SERVER_QUERY_PROTOCOLS=http, raw … etc. Then put that api_key in the post request as FakE says.

2 Likes

Forgot the raw on TS3SERVER_QUERY_PROTOCOLS
thanks :slight_smile:

1 Like

Edit:
now it works I used use 1

1 Like

Btw, could you please allow to pass the api key via query parameter? Then it would be easier to use the api via the browser. It is a bit annoying to pass it via the header. You should allow both ways. Header should be preferred over query, but for quick tinkering it would be nice.

You already can - api-key if my memory is correct (hope so, can’t check right now)

Edit: fixed, my memory was not right

4 Likes

I tried api_key, key and apikey.

Show me what you’re doing - something like a POST/GET on /1/channellist?api-key=myapikey should work fine.

1 Like

Ok yes, with api-key it works :slight_smile: