獲取符合通過條件的客戶聯係人
請求參數
參數 | 類型 | 說明 | 必需的 |
---|---|---|---|
action | string | “GetContacts” | Required |
limitstart | int | 返回的日誌數據的偏移量(默認值:0) | Optional |
limitnum | int | 返回的記錄數(默認:25) | Optional |
userid | int | 查找特定客戶 ID 的聯係人 | Optional |
firstname | string | 查找具有特定名字的聯係人 | Optional |
lastname | string | 查找具有特定姓氏的聯係人 | Optional |
companyname | string | 查找具有特定公司名稱的聯係人 | Optional |
string | 查找具有特定電子郵件地址的聯係人 | Optional | |
address1 | string | 查找具有特定地址行的聯係人 1 | Optional |
address2 | string | 查找具有特定地址行的聯係人 2 | Optional |
city | string | 查找特定城市的聯係人 | Optional |
state | string | 查找具有特定狀態的聯係人 | Optional |
postcode | string | 查找具有特定郵政編碼的聯係人 | Optional |
country | string | 查找與特定國家/地區的聯係人 | Optional |
phonenumber | string | 查找具有特定電話號碼的聯係人 | Optional |
響應參數
參數 | 類型 | 說明 |
---|---|---|
result | string | 操作結果:成功或錯誤 |
totalresults | int | 可用結果總數 |
startnumber | int | 返回結果的起始編號 |
numreturned | int | 返回的結果數 |
contacts | array | 返回的聯係人條目 |
示例請求 (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' => 'GetContacts',
// See https://developers.whmcs.com/api/authentication
'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',
'password' => 'SECRET_OR_HASHED_PASSWORD',
'userid' => '1',
'responsetype' => 'json',
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
示例請求(本地 API)
$command = 'GetContacts';
$postData = array(
'userid' => '1',
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later
$results = localAPI($command, $postData, $adminUsername);
print_r($results);
示例響應 JSON
{
"result": "success",
"totalresults": 1,
"startnumber": 0,
"numreturned": 1,
"contacts": {
"contact": [
{
"id": 1,
"userid": 1,
"firstname": "Test",
"lastname": "Contact",
"email": "[email protected]",
"address1": "404 Street Not Found",
"address2": "",
"city": "Test",
"state": "Test",
"postcode": "TE5 5ST",
"country": "GB",
"phonenumber": "",
"domainemails": true,
"generalemails": true,
"invoiceemails": true,
"productemails": true,
"supportemails": true,
"affiliateemails": true,
"created_at": "0000-00-00 00:00:00",
"updated_at": "0000-00-00 00:00:00"
}
]
}
}
相關用法
- PHP WHMCS GetConfigurationValue用法及代碼示例
- PHP WHMCS GetCurrencies用法及代碼示例
- PHP WHMCS GetClientPassword用法及代碼示例
- PHP WHMCS GetClientsDomains用法及代碼示例
- PHP WHMCS GetCredits用法及代碼示例
- PHP WHMCS GetClientsAddons用法及代碼示例
- PHP WHMCS GetClients用法及代碼示例
- PHP WHMCS GetClientsDetails用法及代碼示例
- PHP WHMCS GetClientGroups用法及代碼示例
- PHP WHMCS GetCancelledPackages用法及代碼示例
- PHP WHMCS GetClientsProducts用法及代碼示例
- PHP WHMCS GetTicketNotes用法及代碼示例
- PHP WHMCS GetUsers用法及代碼示例
- PHP WHMCS GetTLDPricing用法及代碼示例
- PHP WHMCS GetToDoItemStatuses用法及代碼示例
- PHP WHMCS GetPermissionsList用法及代碼示例
- PHP WHMCS GetStaffOnline用法及代碼示例
- PHP WHMCS GetEmails用法及代碼示例
- PHP WHMCS GetPromotions用法及代碼示例
- PHP WHMCS GetRegistrars用法及代碼示例
- PHP WHMCS GetAutomationLog用法及代碼示例
- PHP WHMCS GetQuotes用法及代碼示例
- PHP WHMCS GetActivityLog用法及代碼示例
- PHP WHMCS GetPaymentMethods用法及代碼示例
- PHP WHMCS GetModuleQueue用法及代碼示例
注:本文由純淨天空篩選整理自whmcs.com大神的英文原創作品 GetContacts。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。