Setup Ships
curl --request POST \
--url http://50.187.81.221:4000/api/v1/cubic/setupShips \
--header 'Content-Type: application/json' \
--data '
{
"gameID": "uniqueGame123",
"teamName": "RedTeam",
"ships": [
{
"name": "RedScout1",
"shipType": "SCOUT",
"stats": {
"moveFactor": 3,
"attackFactor": 1,
"defenseFactor": 1,
"attackRange": 1
}
},
{
"name": "RedDestroyer1",
"shipType": "DESTROYER",
"stats": {
"moveFactor": 2,
"attackFactor": 2,
"defenseFactor": 2,
"attackRange": 1
}
}
]
}
'import requests
url = "http://50.187.81.221:4000/api/v1/cubic/setupShips"
payload = {
"gameID": "uniqueGame123",
"teamName": "RedTeam",
"ships": [
{
"name": "RedScout1",
"shipType": "SCOUT",
"stats": {
"moveFactor": 3,
"attackFactor": 1,
"defenseFactor": 1,
"attackRange": 1
}
},
{
"name": "RedDestroyer1",
"shipType": "DESTROYER",
"stats": {
"moveFactor": 2,
"attackFactor": 2,
"defenseFactor": 2,
"attackRange": 1
}
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
gameID: 'uniqueGame123',
teamName: 'RedTeam',
ships: [
{
name: 'RedScout1',
shipType: 'SCOUT',
stats: {moveFactor: 3, attackFactor: 1, defenseFactor: 1, attackRange: 1}
},
{
name: 'RedDestroyer1',
shipType: 'DESTROYER',
stats: {moveFactor: 2, attackFactor: 2, defenseFactor: 2, attackRange: 1}
}
]
})
};
fetch('http://50.187.81.221:4000/api/v1/cubic/setupShips', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "4000",
CURLOPT_URL => "http://50.187.81.221:4000/api/v1/cubic/setupShips",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'gameID' => 'uniqueGame123',
'teamName' => 'RedTeam',
'ships' => [
[
'name' => 'RedScout1',
'shipType' => 'SCOUT',
'stats' => [
'moveFactor' => 3,
'attackFactor' => 1,
'defenseFactor' => 1,
'attackRange' => 1
]
],
[
'name' => 'RedDestroyer1',
'shipType' => 'DESTROYER',
'stats' => [
'moveFactor' => 2,
'attackFactor' => 2,
'defenseFactor' => 2,
'attackRange' => 1
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://50.187.81.221:4000/api/v1/cubic/setupShips"
payload := strings.NewReader("{\n \"gameID\": \"uniqueGame123\",\n \"teamName\": \"RedTeam\",\n \"ships\": [\n {\n \"name\": \"RedScout1\",\n \"shipType\": \"SCOUT\",\n \"stats\": {\n \"moveFactor\": 3,\n \"attackFactor\": 1,\n \"defenseFactor\": 1,\n \"attackRange\": 1\n }\n },\n {\n \"name\": \"RedDestroyer1\",\n \"shipType\": \"DESTROYER\",\n \"stats\": {\n \"moveFactor\": 2,\n \"attackFactor\": 2,\n \"defenseFactor\": 2,\n \"attackRange\": 1\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://50.187.81.221:4000/api/v1/cubic/setupShips")
.header("Content-Type", "application/json")
.body("{\n \"gameID\": \"uniqueGame123\",\n \"teamName\": \"RedTeam\",\n \"ships\": [\n {\n \"name\": \"RedScout1\",\n \"shipType\": \"SCOUT\",\n \"stats\": {\n \"moveFactor\": 3,\n \"attackFactor\": 1,\n \"defenseFactor\": 1,\n \"attackRange\": 1\n }\n },\n {\n \"name\": \"RedDestroyer1\",\n \"shipType\": \"DESTROYER\",\n \"stats\": {\n \"moveFactor\": 2,\n \"attackFactor\": 2,\n \"defenseFactor\": 2,\n \"attackRange\": 1\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://50.187.81.221:4000/api/v1/cubic/setupShips")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"gameID\": \"uniqueGame123\",\n \"teamName\": \"RedTeam\",\n \"ships\": [\n {\n \"name\": \"RedScout1\",\n \"shipType\": \"SCOUT\",\n \"stats\": {\n \"moveFactor\": 3,\n \"attackFactor\": 1,\n \"defenseFactor\": 1,\n \"attackRange\": 1\n }\n },\n {\n \"name\": \"RedDestroyer1\",\n \"shipType\": \"DESTROYER\",\n \"stats\": {\n \"moveFactor\": 2,\n \"attackFactor\": 2,\n \"defenseFactor\": 2,\n \"attackRange\": 1\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyCubic
Setup Ships
Configures the fleet for a specific team within an existing game, assigning names, types, and combat statistics to each ship.
POST
/
api
/
v1
/
cubic
/
setupShips
Setup Ships
curl --request POST \
--url http://50.187.81.221:4000/api/v1/cubic/setupShips \
--header 'Content-Type: application/json' \
--data '
{
"gameID": "uniqueGame123",
"teamName": "RedTeam",
"ships": [
{
"name": "RedScout1",
"shipType": "SCOUT",
"stats": {
"moveFactor": 3,
"attackFactor": 1,
"defenseFactor": 1,
"attackRange": 1
}
},
{
"name": "RedDestroyer1",
"shipType": "DESTROYER",
"stats": {
"moveFactor": 2,
"attackFactor": 2,
"defenseFactor": 2,
"attackRange": 1
}
}
]
}
'import requests
url = "http://50.187.81.221:4000/api/v1/cubic/setupShips"
payload = {
"gameID": "uniqueGame123",
"teamName": "RedTeam",
"ships": [
{
"name": "RedScout1",
"shipType": "SCOUT",
"stats": {
"moveFactor": 3,
"attackFactor": 1,
"defenseFactor": 1,
"attackRange": 1
}
},
{
"name": "RedDestroyer1",
"shipType": "DESTROYER",
"stats": {
"moveFactor": 2,
"attackFactor": 2,
"defenseFactor": 2,
"attackRange": 1
}
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
gameID: 'uniqueGame123',
teamName: 'RedTeam',
ships: [
{
name: 'RedScout1',
shipType: 'SCOUT',
stats: {moveFactor: 3, attackFactor: 1, defenseFactor: 1, attackRange: 1}
},
{
name: 'RedDestroyer1',
shipType: 'DESTROYER',
stats: {moveFactor: 2, attackFactor: 2, defenseFactor: 2, attackRange: 1}
}
]
})
};
fetch('http://50.187.81.221:4000/api/v1/cubic/setupShips', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "4000",
CURLOPT_URL => "http://50.187.81.221:4000/api/v1/cubic/setupShips",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'gameID' => 'uniqueGame123',
'teamName' => 'RedTeam',
'ships' => [
[
'name' => 'RedScout1',
'shipType' => 'SCOUT',
'stats' => [
'moveFactor' => 3,
'attackFactor' => 1,
'defenseFactor' => 1,
'attackRange' => 1
]
],
[
'name' => 'RedDestroyer1',
'shipType' => 'DESTROYER',
'stats' => [
'moveFactor' => 2,
'attackFactor' => 2,
'defenseFactor' => 2,
'attackRange' => 1
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://50.187.81.221:4000/api/v1/cubic/setupShips"
payload := strings.NewReader("{\n \"gameID\": \"uniqueGame123\",\n \"teamName\": \"RedTeam\",\n \"ships\": [\n {\n \"name\": \"RedScout1\",\n \"shipType\": \"SCOUT\",\n \"stats\": {\n \"moveFactor\": 3,\n \"attackFactor\": 1,\n \"defenseFactor\": 1,\n \"attackRange\": 1\n }\n },\n {\n \"name\": \"RedDestroyer1\",\n \"shipType\": \"DESTROYER\",\n \"stats\": {\n \"moveFactor\": 2,\n \"attackFactor\": 2,\n \"defenseFactor\": 2,\n \"attackRange\": 1\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://50.187.81.221:4000/api/v1/cubic/setupShips")
.header("Content-Type", "application/json")
.body("{\n \"gameID\": \"uniqueGame123\",\n \"teamName\": \"RedTeam\",\n \"ships\": [\n {\n \"name\": \"RedScout1\",\n \"shipType\": \"SCOUT\",\n \"stats\": {\n \"moveFactor\": 3,\n \"attackFactor\": 1,\n \"defenseFactor\": 1,\n \"attackRange\": 1\n }\n },\n {\n \"name\": \"RedDestroyer1\",\n \"shipType\": \"DESTROYER\",\n \"stats\": {\n \"moveFactor\": 2,\n \"attackFactor\": 2,\n \"defenseFactor\": 2,\n \"attackRange\": 1\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://50.187.81.221:4000/api/v1/cubic/setupShips")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"gameID\": \"uniqueGame123\",\n \"teamName\": \"RedTeam\",\n \"ships\": [\n {\n \"name\": \"RedScout1\",\n \"shipType\": \"SCOUT\",\n \"stats\": {\n \"moveFactor\": 3,\n \"attackFactor\": 1,\n \"defenseFactor\": 1,\n \"attackRange\": 1\n }\n },\n {\n \"name\": \"RedDestroyer1\",\n \"shipType\": \"DESTROYER\",\n \"stats\": {\n \"moveFactor\": 2,\n \"attackFactor\": 2,\n \"defenseFactor\": 2,\n \"attackRange\": 1\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Details for setting up a team's fleet, including the game ID, team name, and a list of ships with their types and stats.
Data transfer object for defining the entire fleet for a specific team in a game.
Response
201
Ships successfully set up for the specified team.
⌘I