# API: invite Client Team

# inviteClientTeam

invite Client Team

# Required parameters

Parameter Description
id Client Id to invite team to
name Team name
code Invitation code of remote team

# Optional parameters

Parameter Description
description Team Description
status One of: Active,Closed,Pending,Rejected

# Request

GET /admin/api.php?api_id=API_ID&api_key=API_KEY&call=inviteClientTeam&id=ID&name=NAME&code=CODE

# PHP Samples

$url = 'http://url_to_hb.com/admin/api.php';
$post = [
  'call' => 'inviteClientTeam',
  'api_id' => $API_ID,
  'api_key' => $API_KEY,
  'id' => $ID,
  'name' => $NAME,
  'code' => $CODE,
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$data = curl_exec($ch);
curl_close($ch);

$return = json_decode($data, true);
print_r($return);
include 'class.hbwrapper.php';
HBWrapper::setAPI('http://url_to_hb.com/admin/api.php','API ID','API Key');
$params = [
  'id' => $ID,
  'name' => $NAME,
  'code' => $CODE,
];
$return = HBWrapper::singleton()->inviteClientTeam($params);
print_r($return);
/* Use this method to access HostBill api from HostBill modules */
$api = new ApiWrapper();
$params = [
  'id' => $ID,
  'name' => $NAME,
  'code' => $CODE,
];
$return = $api->inviteClientTeam($params);
print_r($return);

# Response

{
    "success": true,
    "call": "inviteClientTeam",
    "server_time": 1713252266,
    "info": [
        "Team invite added"
    ]
}
Last Updated: 10/7/2024, 2:36:43 PM