# API: Get Staff Member

# getStaffMember

Get Staff Member details by id

# Required parameters

Parameter Description
id Staff Id

# Request

GET /admin/api.php?api_id=API_ID&api_key=API_KEY&call=getStaffMember&id=ID

# PHP Samples

$url = 'http://url_to_hb.com/admin/api.php';
$post = [
  'call' => 'getStaffMember',
  'api_id' => $API_ID,
  'api_key' => $API_KEY,
  'id' => $ID,
];
$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,
];
$return = HBWrapper::singleton()->getStaffMember($params);
print_r($return);
/* Use this method to access HostBill api from HostBill modules */
$api = new ApiWrapper();
$params = [
  'id' => $ID,
];
$return = $api->getStaffMember($params);
print_r($return);

# Response

{
    "success": true,
    "admin": {
        "id": "2",
        "firstname": "John",
        "lastname": "Doe",
        "email": "john@hostbillapp.com",
        "signature": "",
        "ui_config": {
            "clienttabs_visible": {
                "Contacts": 1,
                "Contracts": 1,
                "Orders": 1,
                "Services": 1,
                "Domains": 1,
                "Invoices": 1,
                "Estimates": 1,
                "Recurring Invoices": 1,
                "Transactions": 1,
                "Tickets": 1,
                "Logs": 1,
                "Access List": 1,
                "Grouped Services": 1
            },
            "search_on": {
                "Clients": 1,
                "Contacts": 1,
                "Orders": 1,
                "Accounts": 1,
                "Domains": 1,
                "DNS": 1,
                "Invoices": 1,
                "Estimates": 1,
                "Transactions": 1,
                "Tickets": 1,
                "Products": 1
            },
            "format": 1
        },
        "username": "John Doe",
        "status": "Active",
        "access": [
            ""
        ],
        "emails": [],
        "mfamodule": "",
        "teamAccess": {
            "": [
                "Team A",
                "Team C",
                ""
            ]
        },
        "teams": [
            "1",
            "4",
            "10"
        ],
        "mobilephone": "",
        "fields": {
            "mobilephone": {
                "name": "Mobile phone number",
                "id": "1",
                "type": "input",
                "default": ""
            }
        }
    },
    "call": "getStaffMember",
    "server_time": 1718954403
}
Last Updated: 10/7/2024, 2:36:43 PM