Skip to main content
POST
/
v0
/
serverhost-gateway
/
resolve
Resolve a serverhost gateway target
curl --request POST \
  --url https://controller.platform.simplecloud.app/v0/serverhost-gateway/resolve \
  --header 'Content-Type: application/json' \
  --header 'X-Network-ID: <x-network-id>' \
  --header 'X-Network-Secret: <x-network-secret>' \
  --data '
{
  "serverhost_id": "123e4567-e89b-12d3-a456-426614174000",
  "slug": "9f1f7f2c9a224bb29f9e0f7e5b2a070a"
}
'
import requests

url = "https://controller.platform.simplecloud.app/v0/serverhost-gateway/resolve"

payload = {
"serverhost_id": "123e4567-e89b-12d3-a456-426614174000",
"slug": "9f1f7f2c9a224bb29f9e0f7e5b2a070a"
}
headers = {
"X-Network-ID": "<x-network-id>",
"X-Network-Secret": "<x-network-secret>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'X-Network-ID': '<x-network-id>',
'X-Network-Secret': '<x-network-secret>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
serverhost_id: '123e4567-e89b-12d3-a456-426614174000',
slug: '9f1f7f2c9a224bb29f9e0f7e5b2a070a'
})
};

fetch('https://controller.platform.simplecloud.app/v0/serverhost-gateway/resolve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://controller.platform.simplecloud.app/v0/serverhost-gateway/resolve",
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([
'serverhost_id' => '123e4567-e89b-12d3-a456-426614174000',
'slug' => '9f1f7f2c9a224bb29f9e0f7e5b2a070a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Network-ID: <x-network-id>",
"X-Network-Secret: <x-network-secret>"
],
]);

$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 := "https://controller.platform.simplecloud.app/v0/serverhost-gateway/resolve"

payload := strings.NewReader("{\n \"serverhost_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"slug\": \"9f1f7f2c9a224bb29f9e0f7e5b2a070a\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Network-ID", "<x-network-id>")
req.Header.Add("X-Network-Secret", "<x-network-secret>")
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("https://controller.platform.simplecloud.app/v0/serverhost-gateway/resolve")
.header("X-Network-ID", "<x-network-id>")
.header("X-Network-Secret", "<x-network-secret>")
.header("Content-Type", "application/json")
.body("{\n \"serverhost_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"slug\": \"9f1f7f2c9a224bb29f9e0f7e5b2a070a\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://controller.platform.simplecloud.app/v0/serverhost-gateway/resolve")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Network-ID"] = '<x-network-id>'
request["X-Network-Secret"] = '<x-network-secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"serverhost_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"slug\": \"9f1f7f2c9a224bb29f9e0f7e5b2a070a\"\n}"

response = http.request(request)
puts response.read_body
{
  "host_name": "ServerHost-1",
  "network_id": "123e4567-e89b-12d3-a456-426614174000",
  "serverhost_id": "123e4567-e89b-12d3-a456-426614174000",
  "slug": "9f1f7f2c9a224bb29f9e0f7e5b2a070a"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}

Headers

X-Network-ID
string
required

Network ID

X-Network-Secret
string
required

Network Secret

Body

application/json

Serverhost gateway target

serverhost_id
string
Example:

"123e4567-e89b-12d3-a456-426614174000"

slug
string
Example:

"9f1f7f2c9a224bb29f9e0f7e5b2a070a"

Response

OK

host_name
string
Example:

"ServerHost-1"

network_id
string
Example:

"123e4567-e89b-12d3-a456-426614174000"

serverhost_id
string
Example:

"123e4567-e89b-12d3-a456-426614174000"

slug
string
Example:

"9f1f7f2c9a224bb29f9e0f7e5b2a070a"