HTTP Commands API

Commands

executePost

Execute commands

Execute one or more Minecraft commands on the server. Commands are executed sequentially in the order they are provided. ## Wait for Player Use the `waitForPlayer` parameter to delay command execution until a specific player joins the server. If the player is already online, commands execute immediately. If the player is offline, commands are saved and will execute when the player joins.


/execute

Usage and SDK Samples

curl -X POST \
 -H "Authorization: Bearer [[accessToken]]" \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "http://localhost:8080/execute" \
 -d '{
  "waitForPlayer" : "Player1",
  "commands" : [ "say Hello!", "give Player1 diamond 1" ]
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CommandsApi;

import java.io.File;
import java.util.*;

public class CommandsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure Bearer (JWT) access token for authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        // Create an instance of the API class
        CommandsApi apiInstance = new CommandsApi();
        CommandRequest commandRequest = {"commands":["say Hello from HTTP API!"]}; // CommandRequest | 

        try {
            CommandResponse result = apiInstance.executePost(commandRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CommandsApi#executePost");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final CommandRequest commandRequest = new CommandRequest(); // CommandRequest | 

try {
    final result = await api_instance.executePost(commandRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->executePost: $e\n');
}

import org.openapitools.client.api.CommandsApi;

public class CommandsApiExample {
    public static void main(String[] args) {
        CommandsApi apiInstance = new CommandsApi();
        CommandRequest commandRequest = {"commands":["say Hello from HTTP API!"]}; // CommandRequest | 

        try {
            CommandResponse result = apiInstance.executePost(commandRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CommandsApi#executePost");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure Bearer (JWT) access token for authorization: bearerAuth
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

// Create an instance of the API class
CommandsApi *apiInstance = [[CommandsApi alloc] init];
CommandRequest *commandRequest = {"commands":["say Hello from HTTP API!"]}; // 

// Execute commands
[apiInstance executePostWith:commandRequest
              completionHandler: ^(CommandResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var HttpCommandsApi = require('http_commands_api');
var defaultClient = HttpCommandsApi.ApiClient.instance;

// Configure Bearer (JWT) access token for authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new HttpCommandsApi.CommandsApi()
var commandRequest = {"commands":["say Hello from HTTP API!"]}; // {CommandRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.executePost(commandRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class executePostExample
    {
        public void main()
        {
            // Configure Bearer (JWT) access token for authorization: bearerAuth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CommandsApi();
            var commandRequest = new CommandRequest(); // CommandRequest | 

            try {
                // Execute commands
                CommandResponse result = apiInstance.executePost(commandRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CommandsApi.executePost: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure Bearer (JWT) access token for authorization: bearerAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('', 'YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CommandsApi();
$commandRequest = {"commands":["say Hello from HTTP API!"]}; // CommandRequest | 

try {
    $result = $api_instance->executePost($commandRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommandsApi->executePost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CommandsApi;

# Configure Bearer (JWT) access token for authorization: bearerAuth
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CommandsApi->new();
my $commandRequest = WWW::OPenAPIClient::Object::CommandRequest->new(); # CommandRequest | 

eval {
    my $result = $api_instance->executePost(commandRequest => $commandRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CommandsApi->executePost: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure Bearer (JWT) access token for authorization: bearerAuth
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CommandsApi()
commandRequest = {"commands":["say Hello from HTTP API!"]} # CommandRequest | 

try:
    # Execute commands
    api_response = api_instance.execute_post(commandRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CommandsApi->executePost: %s\n" % e)
extern crate CommandsApi;

pub fn main() {
    let commandRequest = {"commands":["say Hello from HTTP API!"]}; // CommandRequest

    let mut context = CommandsApi::Context::default();
    let result = client.executePost(commandRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Body parameters
Name Description
commandRequest *

Responses


Players

playersGet

Get online players

Returns a list of currently online players with player count and max players


/players

Usage and SDK Samples

curl -X GET \
 -H "Authorization: Bearer [[accessToken]]" \
 -H "Accept: application/json" \
 "http://localhost:8080/players"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PlayersApi;

import java.io.File;
import java.util.*;

public class PlayersApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure Bearer (JWT) access token for authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        // Create an instance of the API class
        PlayersApi apiInstance = new PlayersApi();

        try {
            PlayersList result = apiInstance.playersGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PlayersApi#playersGet");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();


try {
    final result = await api_instance.playersGet();
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->playersGet: $e\n');
}

import org.openapitools.client.api.PlayersApi;

public class PlayersApiExample {
    public static void main(String[] args) {
        PlayersApi apiInstance = new PlayersApi();

        try {
            PlayersList result = apiInstance.playersGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PlayersApi#playersGet");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure Bearer (JWT) access token for authorization: bearerAuth
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

// Create an instance of the API class
PlayersApi *apiInstance = [[PlayersApi alloc] init];

// Get online players
[apiInstance playersGetWithCompletionHandler: 
              ^(PlayersList output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var HttpCommandsApi = require('http_commands_api');
var defaultClient = HttpCommandsApi.ApiClient.instance;

// Configure Bearer (JWT) access token for authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new HttpCommandsApi.PlayersApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.playersGet(callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class playersGetExample
    {
        public void main()
        {
            // Configure Bearer (JWT) access token for authorization: bearerAuth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new PlayersApi();

            try {
                // Get online players
                PlayersList result = apiInstance.playersGet();
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling PlayersApi.playersGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure Bearer (JWT) access token for authorization: bearerAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('', 'YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PlayersApi();

try {
    $result = $api_instance->playersGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PlayersApi->playersGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PlayersApi;

# Configure Bearer (JWT) access token for authorization: bearerAuth
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PlayersApi->new();

eval {
    my $result = $api_instance->playersGet();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PlayersApi->playersGet: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure Bearer (JWT) access token for authorization: bearerAuth
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.PlayersApi()

try:
    # Get online players
    api_response = api_instance.players_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PlayersApi->playersGet: %s\n" % e)
extern crate PlayersApi;

pub fn main() {

    let mut context = PlayersApi::Context::default();
    let result = client.playersGet(&context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Responses


Server

infoGet

Get server information

Returns server information including player count, max players, and server version


/info

Usage and SDK Samples

curl -X GET \
 -H "Authorization: Bearer [[accessToken]]" \
 -H "Accept: application/json" \
 "http://localhost:8080/info"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ServerApi;

import java.io.File;
import java.util.*;

public class ServerApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure Bearer (JWT) access token for authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        // Create an instance of the API class
        ServerApi apiInstance = new ServerApi();

        try {
            ServerInfo result = apiInstance.infoGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ServerApi#infoGet");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();


try {
    final result = await api_instance.infoGet();
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->infoGet: $e\n');
}

import org.openapitools.client.api.ServerApi;

public class ServerApiExample {
    public static void main(String[] args) {
        ServerApi apiInstance = new ServerApi();

        try {
            ServerInfo result = apiInstance.infoGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ServerApi#infoGet");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure Bearer (JWT) access token for authorization: bearerAuth
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

// Create an instance of the API class
ServerApi *apiInstance = [[ServerApi alloc] init];

// Get server information
[apiInstance infoGetWithCompletionHandler: 
              ^(ServerInfo output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var HttpCommandsApi = require('http_commands_api');
var defaultClient = HttpCommandsApi.ApiClient.instance;

// Configure Bearer (JWT) access token for authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new HttpCommandsApi.ServerApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.infoGet(callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class infoGetExample
    {
        public void main()
        {
            // Configure Bearer (JWT) access token for authorization: bearerAuth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ServerApi();

            try {
                // Get server information
                ServerInfo result = apiInstance.infoGet();
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ServerApi.infoGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure Bearer (JWT) access token for authorization: bearerAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('', 'YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ServerApi();

try {
    $result = $api_instance->infoGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ServerApi->infoGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ServerApi;

# Configure Bearer (JWT) access token for authorization: bearerAuth
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ServerApi->new();

eval {
    my $result = $api_instance->infoGet();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ServerApi->infoGet: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure Bearer (JWT) access token for authorization: bearerAuth
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ServerApi()

try:
    # Get server information
    api_response = api_instance.info_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ServerApi->infoGet: %s\n" % e)
extern crate ServerApi;

pub fn main() {

    let mut context = ServerApi::Context::default();
    let result = client.infoGet(&context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Responses