curl --request GET \
--url https://console.advinservers.com/api/v1/client/teams/context \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.advinservers.com/api/v1/client/teams/context"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://console.advinservers.com/api/v1/client/teams/context', 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://console.advinservers.com/api/v1/client/teams/context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://console.advinservers.com/api/v1/client/teams/context"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://console.advinservers.com/api/v1/client/teams/context")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.advinservers.com/api/v1/client/teams/context")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"active": {
"id": "fbb31f5f-bd6f-4019-a3ed-1062a28f56f7",
"name": "Anomalous Materials",
"is_owner": true,
"owner": {
"name": "Gordon Freeman",
"email": "gordon.freeman@blackmesa.example.com"
},
"role": null,
"permissions": [
"team.read",
"team.manage",
"server.read",
"server.power",
"server.console",
"server.update",
"server.credentials",
"server.reinstall",
"server.transfer",
"backup.read",
"backup.create",
"backup.restore",
"backup.delete",
"snapshot.read",
"snapshot.create",
"snapshot.restore",
"snapshot.delete",
"snapshot.update",
"snapshot.transfer",
"firewall.read",
"firewall.update",
"firewall.delete",
"network.read",
"network.update",
"network.transfer",
"network.delete",
"sshkey.read",
"sshkey.update",
"sshkey.delete",
"script.read",
"script.update",
"script.delete",
"iso.read",
"iso.update",
"iso.delete",
"measured_boot.read",
"measured_boot.update",
"measured_boot.delete",
"billing.read",
"billing.manage",
"billing.purchase"
]
},
"teams": [
{
"id": "fbb31f5f-bd6f-4019-a3ed-1062a28f56f7",
"name": "Anomalous Materials",
"is_owner": true,
"is_default": true,
"is_active": true,
"role": null
},
{
"id": "48454223-c5ac-461f-bead-ba8dda13eea9",
"name": "Lambda Complex",
"is_owner": true,
"is_default": false,
"is_active": false,
"role": null
}
],
"owned_team_count": 2,
"membership_count": 0,
"other_team_count": 1
}{
"message": "Unauthenticated."
}{
"message": "This API key is not allowed to do that in this team. It needs the \"snapshot.delete\" permission."
}{
"message": "Too Many Attempts."
}Get the current team
Overview
Returns the current team, its owner, your role and permissions under active. teams lists the teams you can access, with owned teams first. The remaining fields count owned teams, memberships and teams other than the current one. Leaving or deleting a team selects the account’s default team.
Permissions
Requires the account permission teams.read (View teams).
curl --request GET \
--url https://console.advinservers.com/api/v1/client/teams/context \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.advinservers.com/api/v1/client/teams/context"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://console.advinservers.com/api/v1/client/teams/context', 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://console.advinservers.com/api/v1/client/teams/context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://console.advinservers.com/api/v1/client/teams/context"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://console.advinservers.com/api/v1/client/teams/context")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.advinservers.com/api/v1/client/teams/context")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"active": {
"id": "fbb31f5f-bd6f-4019-a3ed-1062a28f56f7",
"name": "Anomalous Materials",
"is_owner": true,
"owner": {
"name": "Gordon Freeman",
"email": "gordon.freeman@blackmesa.example.com"
},
"role": null,
"permissions": [
"team.read",
"team.manage",
"server.read",
"server.power",
"server.console",
"server.update",
"server.credentials",
"server.reinstall",
"server.transfer",
"backup.read",
"backup.create",
"backup.restore",
"backup.delete",
"snapshot.read",
"snapshot.create",
"snapshot.restore",
"snapshot.delete",
"snapshot.update",
"snapshot.transfer",
"firewall.read",
"firewall.update",
"firewall.delete",
"network.read",
"network.update",
"network.transfer",
"network.delete",
"sshkey.read",
"sshkey.update",
"sshkey.delete",
"script.read",
"script.update",
"script.delete",
"iso.read",
"iso.update",
"iso.delete",
"measured_boot.read",
"measured_boot.update",
"measured_boot.delete",
"billing.read",
"billing.manage",
"billing.purchase"
]
},
"teams": [
{
"id": "fbb31f5f-bd6f-4019-a3ed-1062a28f56f7",
"name": "Anomalous Materials",
"is_owner": true,
"is_default": true,
"is_active": true,
"role": null
},
{
"id": "48454223-c5ac-461f-bead-ba8dda13eea9",
"name": "Lambda Complex",
"is_owner": true,
"is_default": false,
"is_active": false,
"role": null
}
],
"owned_team_count": 2,
"membership_count": 0,
"other_team_count": 1
}{
"message": "Unauthenticated."
}{
"message": "This API key is not allowed to do that in this team. It needs the \"snapshot.delete\" permission."
}{
"message": "Too Many Attempts."
}Authorizations
Your API key, sent as a bearer token. Create one in the control panel under API Keys, give it only the permissions the integration needs, and copy it when it is created. It cannot be shown again. Each key is restricted to one owned team. The key determines the team for every request.
Response
The record, as a JSON object. There is no envelope.
The team this request is working in.
Show child attributes
Show child attributes
{
"id": "fbb31f5f-bd6f-4019-a3ed-1062a28f56f7",
"name": "Anomalous Materials",
"is_owner": true,
"owner": {
"name": "Gordon Freeman",
"email": "gordon.freeman@blackmesa.example.com"
},
"role": null,
"permissions": [
"team.read",
"team.manage",
"server.read",
"server.power",
"server.console",
"server.update",
"server.credentials",
"server.reinstall",
"server.transfer",
"backup.read",
"backup.create",
"backup.restore",
"backup.delete",
"snapshot.read",
"snapshot.create",
"snapshot.restore",
"snapshot.delete",
"snapshot.update",
"snapshot.transfer",
"firewall.read",
"firewall.update",
"firewall.delete",
"network.read",
"network.update",
"network.transfer",
"network.delete",
"sshkey.read",
"sshkey.update",
"sshkey.delete",
"script.read",
"script.update",
"script.delete",
"iso.read",
"iso.update",
"iso.delete",
"measured_boot.read",
"measured_boot.update",
"measured_boot.delete",
"billing.read",
"billing.manage",
"billing.purchase"
]
}
Every team the account can work in, the ones it owns first and its default first among those.
Show child attributes
Show child attributes
[
{
"id": "fbb31f5f-bd6f-4019-a3ed-1062a28f56f7",
"name": "Anomalous Materials",
"is_owner": true,
"is_default": true,
"is_active": true,
"role": null
},
{
"id": "48454223-c5ac-461f-bead-ba8dda13eea9",
"name": "Lambda Complex",
"is_owner": true,
"is_default": false,
"is_active": false,
"role": null
}
]
How many teams the account owns.
2
How many teams the account has been invited into.
0
Those two added together, less the one this request is in.
1