Teams

Manage your teams.

Get

HTTP Request

	GET https://serverwand.com/api/teams

Sample Code

	<?php
	
	$api_key = 'YOUR_API_KEY';

	$ch = curl_init();

	curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/teams");
	curl_setopt($ch, CURLOPT_HTTPHEADER, [
	'Authorization: Bearer ' . $api_key
	]);

		// receive server response
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	$result = curl_exec($ch);
	curl_close ($ch);

	print_r($result);



Sample Response

	{
    "success": true,
    "items": [
        {
            "id": "1",
            "name": "my team",
            "servers": "1",
            "members": "5"
        }
    ]
}



Create

HTTP Request

	POST https://serverwand.com/api/teams

Parameters

Parameter Value Description
Required
name string

Sample Code

	<?php
			$data = [
    "name"=> "my-team"
]
	$api_key = 'YOUR_API_KEY';

	$ch = curl_init();

	curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/teams");
	curl_setopt($ch, CURLOPT_HTTPHEADER, [
	'Authorization: Bearer ' . $api_key
	]);

			curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

			// receive server response
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	$result = curl_exec($ch);
	curl_close ($ch);

	print_r($result);



Sample Response

	{
    "success": true
}



Update

HTTP Request

	POST https://serverwand.com/api/teams/{$team_id}

Parameters

Parameter Value Description
Required
name string

Sample Code

	<?php
			$data = [
    "name"=> "my-team"
]
	$api_key = 'YOUR_API_KEY';

	$ch = curl_init();

	curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/teams/{$team_id}");
	curl_setopt($ch, CURLOPT_HTTPHEADER, [
	'Authorization: Bearer ' . $api_key
	]);

			curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

			// receive server response
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	$result = curl_exec($ch);
	curl_close ($ch);

	print_r($result);



Sample Response

	{
    "success": true
}



Summary

HTTP Request

	GET https://serverwand.com/api/teams/{$team_id}

Sample Code

	<?php
	
	$api_key = 'YOUR_API_KEY';

	$ch = curl_init();

	curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/teams/{$team_id}");
	curl_setopt($ch, CURLOPT_HTTPHEADER, [
	'Authorization: Bearer ' . $api_key
	]);

		// receive server response
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	$result = curl_exec($ch);
	curl_close ($ch);

	print_r($result);



Sample Response

	{
    "success": true,
    "item": {
        "members": [
            {
                "user": "1",
                "email": "me@domain.com"
            }
        ],
        "servers": [
            {
                "id": "1",
                "name": "my-server"
            }
        ]
    }
}



Add Member

HTTP Request

	POST https://serverwand.com/api/teams/{$team_id}/members

Parameters

Parameter Value Description
Required
email string

Sample Code

	<?php
			$data = [
    "email"=> "collaborator@domain.com"
]
	$api_key = 'YOUR_API_KEY';

	$ch = curl_init();

	curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/teams/{$team_id}/members");
	curl_setopt($ch, CURLOPT_HTTPHEADER, [
	'Authorization: Bearer ' . $api_key
	]);

			curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

			// receive server response
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	$result = curl_exec($ch);
	curl_close ($ch);

	print_r($result);



Sample Response

	{
    "success": true
}



Delete Member

HTTP Request

	POST https://serverwand.com/api/teams/{$team_id}/members

Parameters

Parameter Value Description
Required
delete integer
user string

Sample Code

	<?php
			$data = [
    "delete"=> 1,
    "user"=> "1"
]
	$api_key = 'YOUR_API_KEY';

	$ch = curl_init();

	curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/teams/{$team_id}/members");
	curl_setopt($ch, CURLOPT_HTTPHEADER, [
	'Authorization: Bearer ' . $api_key
	]);

			curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

			// receive server response
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	$result = curl_exec($ch);
	curl_close ($ch);

	print_r($result);



Sample Response

	{
    "success": true
}



Add Server

HTTP Request

	POST https://serverwand.com/api/teams/{$team_id}/servers

Parameters

Parameter Value Description
Required
server string

Sample Code

	<?php
			$data = [
    "server"=> "1"
]
	$api_key = 'YOUR_API_KEY';

	$ch = curl_init();

	curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/teams/{$team_id}/servers");
	curl_setopt($ch, CURLOPT_HTTPHEADER, [
	'Authorization: Bearer ' . $api_key
	]);

			curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

			// receive server response
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	$result = curl_exec($ch);
	curl_close ($ch);

	print_r($result);



Sample Response

	{
    "success": true
}



Delete Server

HTTP Request

	POST https://serverwand.com/api/teams/{$team_id}/servers

Parameters

Parameter Value Description
Required
server string

Sample Code

	<?php
			$data = [
    "server"=> "1"
]
	$api_key = 'YOUR_API_KEY';

	$ch = curl_init();

	curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/teams/{$team_id}/servers");
	curl_setopt($ch, CURLOPT_HTTPHEADER, [
	'Authorization: Bearer ' . $api_key
	]);

			curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

			// receive server response
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	$result = curl_exec($ch);
	curl_close ($ch);

	print_r($result);



Sample Response

	{
    "success": true
}



Delete

HTTP Request

	POST https://serverwand.com/api/teams/{$team_id}

Parameters

Parameter Value Description
Required
delete integer

Sample Code

	<?php
			$data = [
    "delete"=> 1
]
	$api_key = 'YOUR_API_KEY';

	$ch = curl_init();

	curl_setopt($ch, CURLOPT_URL, "https://serverwand.com/api/teams/{$team_id}");
	curl_setopt($ch, CURLOPT_HTTPHEADER, [
	'Authorization: Bearer ' . $api_key
	]);

			curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

			// receive server response
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	$result = curl_exec($ch);
	curl_close ($ch);

	print_r($result);



Sample Response

	{
    "success": true
}