當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


PHP WHMCS GetAdminDetails用法及代碼示例

獲取當前管理員用戶的詳細信息

請求參數

參數 類型 說明 必需的
action string “GetAdminDetails” Required

響應參數

參數 類型 說明
result string 操作結果:成功或錯誤
adminid int 當前管理員 ID。
name string 管理員用戶的全名。
notes string 管理員用戶的當前注釋。
signature string 支持票簽名。
allowedpermissions string 管理員用戶可用的所有權限的逗號分隔列表。
departments string 管理員用戶所屬的所有支持部門的逗號分隔列表。
requesttime string 請求的日期和時間。
whmcs array 當前 WHMCS 安裝的版本詳細信息

示例請求 (CURL)

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.example.com/includes/api.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
    http_build_query(
        array(
            'action' => 'GetAdminDetails',
            // See https://developers.whmcs.com/api/authentication
            'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',
            'password' => 'SECRET_OR_HASHED_PASSWORD',
            'responsetype' => 'json',
        )
    )
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);

示例請求(本地 API)

$command = 'GetAdminDetails';
$postData = array(
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later

$results = localAPI($command, $postData, $adminUsername);
print_r($results);

示例響應 JSON

{
    "result": "success",
    "adminid": "1",
    "name": "Site Admin",
    "notes": "Welcome to WHMCS!  Please ensure you have setup the cron job to automate tasks",
    "signature": "",
    "allowedpermissions": "Main Homepage,My Account,List Clients,List Services,List Addons,List Domains,Add New Client,Edit Clients Details,Manage Pay Methods,View Clients Products\/Services,Edit Clients Products\/Services,Delete Clients Products\/Services,Perform Server Operations,View Clients Domains,Edit Clients Domains,Delete Clients Domains,View Clients Notes,Add\/Edit Client Notes,Delete Client,Mass Mail,View Cancellation Requests,Manage Affiliates,View Orders,Delete Order,View Order Details,Add New Order,List Transactions,Add Transaction,Edit Transaction,Delete Transaction,View Gateway Log,List Invoices,Create Invoice,Manage Invoice,Delete Invoice,Offline Credit Card Processing,Support Center Overview,Manage Announcements,Manage Knowledgebase,Manage Downloads,List Support Tickets,Open New Ticket,Manage Predefined Replies,View Reports,Addon Modules,Link Tracking,Calendar,To-Do List,WHOIS Lookups,Domain Resolver Checker,View Integration Code,WHM Import Script,Database Status,System Cleanup Operations,View PHP Info,View Activity Log,View Admin Log,View Email Message Log,View Ticket Mail Import Log,View WHOIS Lookup Log,Configure General Settings,Configure Administrators,Configure Admin Roles,Configure Servers,Configure Automation Settings,Configure Payment Gateways,Tax Configuration,View Email Templates,View Products\/Services,Configure Product Addons,View Promotions,Configure Domain Pricing,Configure Support Departments,Configure Spam Control,Configure Banned Emails,Configure Domain Registrars,Configure Fraud Protection,Configure Custom Client Fields,API Access,View Flagged Tickets,Configure Database Backups,Manage Network Issues,Manage Quotes,Configure Currencies,Configure Security Questions,Client Data Export,Mass Data Export,View Billable Items,Manage Billable Items,Configure Client Groups,Refund Invoice Payments,Delete Ticket,View Income Totals,Manage Clients Files,Configure Ticket Statuses,Delete Client Notes,Perform Registrar Operations,Create Upgrade\/Downgrade Orders,Configure Addon Modules,Email Marketer,Configure Product Bundles,View Module Debug Log,View Clients Summary,View Support Ticket,Decrypt Full Credit Card Number,Update\/Delete Stored Credit Card,Create\/Edit Promotions,Delete Promotions,View Banned IPs,Add Banned IP,Unban Banned IP,Create\/Edit Email Templates,Delete Email Templates,Manage Email Template Languages,Create New Products\/Services,Edit Products\/Services,Delete Products\/Services,Manage Product Groups,Allow Login as Owner,Configure Order Statuses,Attempts CC Captures,Generate Due Invoices,Create Predefined Replies,Create Predefined Replies,Delete Predefined Replies,Delete Predefined Replies,Configure Two-Factor Authentication,View Credit Log,Manage Credits,WHMCSConnect,Health and Updates,Configure Application Links,Configure OpenID Connect,Update WHMCS,Modify Update Configuration",
    "departments": ",1,",
    "whmcs": {
        "version": "7.10.2",
        "canonicalversion": "7.10.2-release.1"
    }
}

相關用法


注:本文由純淨天空篩選整理自whmcs.com大神的英文原創作品 GetAdminDetails。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。