獲取符合通過條件的票證
請求參數
參數 | 類型 | 說明 | 必需的 |
---|---|---|---|
action | string | “GetTickets” | Required |
limitstart | int | 返回引號數據的偏移量(默認值:0) | Optional |
limitnum | int | 返回的記錄數(默認:25) | Optional |
deptid | int | 獲取特定部門的票 | Optional |
clientid | int | 查找特定客戶 ID 的票證 | Optional |
string | 查找特定非客戶電子郵件地址的票證 | Optional | |
status | string | 查找符合特定狀態的票證。任何配置的狀態加:Awaiting Reply 、All Active Tickets 、My Flagged Tickets |
Optional |
subject | string | 查找包含特定主題的票證 - 使用近似字符串匹配。 | Optional |
ignore_dept_assignments | bool | 傳遞為 true 以不遵守 API 用戶所屬的部門。 | Optional |
響應參數
參數 | 類型 | 說明 |
---|---|---|
result | string | 操作結果:成功或錯誤 |
totalresults | int | 可用結果總數 |
startnumber | int | 返回結果的起始編號 |
numreturned | int | 返回的結果數 |
tickets | array | 與通過的條件匹配的票證數組 |
requestor_name | string | 票證提交者的姓名。 |
requestor_type | string | 工單提交者的類型。 |
requestor_email | string | 票證提交者的電子郵件。 |
owner_name | string | 票證提交者的所有者。 |
示例請求 (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' => 'GetTickets',
// 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 = 'GetTickets';
$postData = array(
);
$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,
"tickets": {
"ticket": [
{
"id": "1",
"tid": "516757",
"deptid": "1",
"userid": "1",
"name": "Cynthia Reilly",
"owner_name": "Cynthia Reilly",
"email": "[email protected]",
"requestor_name": "Cynthia Reilly",
"requestor_email": "[email protected]",
"requestor_type": "Owner",
"cc": "",
"c": "KPqH7yG3",
"date": "2016-01-01 06:26:29",
"subject": "This is a sample ticket",
"status": "Answered",
"priority": "Medium",
"admin": "admin admin",
"attachment": "123456_attachment_name.png",
"attachments": [
{
"filename": "attachment_name.png",
"index": 0
}
],
"attachments_removed": true,
"lastreply": "2016-01-01 06:30:16",
"flag": "0",
"service": ""
}
]
}
}
相關用法
- PHP WHMCS GetTicketNotes用法及代碼示例
- PHP WHMCS GetTicketAttachment用法及代碼示例
- PHP WHMCS GetTicketCounts用法及代碼示例
- PHP WHMCS GetTicketPredefinedCats用法及代碼示例
- PHP WHMCS GetTicket用法及代碼示例
- PHP WHMCS GetTicketPredefinedReplies用法及代碼示例
- PHP WHMCS GetTLDPricing用法及代碼示例
- PHP WHMCS GetToDoItemStatuses用法及代碼示例
- PHP WHMCS GetTransactions用法及代碼示例
- PHP WHMCS GetToDoItems用法及代碼示例
- PHP WHMCS GetUsers用法及代碼示例
- PHP WHMCS GetPermissionsList用法及代碼示例
- PHP WHMCS GetCurrencies用法及代碼示例
- PHP WHMCS GetStaffOnline用法及代碼示例
- PHP WHMCS GetEmails用法及代碼示例
- PHP WHMCS GetClientPassword用法及代碼示例
- PHP WHMCS GetPromotions用法及代碼示例
- PHP WHMCS GetRegistrars用法及代碼示例
- PHP WHMCS GetAutomationLog用法及代碼示例
- PHP WHMCS GetQuotes用法及代碼示例
- PHP WHMCS GetActivityLog用法及代碼示例
- PHP WHMCS GetPaymentMethods用法及代碼示例
- PHP WHMCS GetModuleQueue用法及代碼示例
- PHP WHMCS GetProducts用法及代碼示例
- PHP WHMCS GetProjects用法及代碼示例
注:本文由純淨天空篩選整理自whmcs.com大神的英文原創作品 GetTickets。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。