將 Toggle ID Protect 命令發送到域的注冊商
連接到注冊器並嘗試切換 ID 保護狀態
請求參數
參數 | 類型 | 說明 | 必需的 |
---|---|---|---|
action | string | “DomainToggleIdProtect” | Required |
domainid | int | 要為其切換 ID 保護的域的 ID | Required |
idprotect | bool | 是否應打開 ID 保護 | Optional |
響應參數
參數 | 類型 | 說明 |
---|---|---|
result | 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' => 'DomainToggleIdProtect',
// See https://developers.whmcs.com/api/authentication
'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',
'password' => 'SECRET_OR_HASHED_PASSWORD',
'domainid' => '1',
'idprotect' => true,
'responsetype' => 'json',
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
示例請求(本地 API)
$command = 'DomainToggleIdProtect';
$postData = array(
'domainid' => '1',
'idprotect' => true,
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later
$results = localAPI($command, $postData, $adminUsername);
print_r($results);
示例響應 JSON
{
"result": "success"
}
錯誤響應
可能的錯誤條件響應包括:
- 未找到域 ID
- 注冊商錯誤消息
相關用法
- PHP WHMCS DomainTransferFailed用法及代碼示例
- PHP WHMCS DomainTransfer用法及代碼示例
- PHP WHMCS DomainTransferCompleted用法及代碼示例
- PHP WHMCS DomainGetWhoisInfo用法及代碼示例
- PHP WHMCS DomainDelete用法及代碼示例
- PHP WHMCS DomainUpdateWhoisInfo用法及代碼示例
- PHP WHMCS DomainValidation用法及代碼示例
- PHP WHMCS DomainUpdateLockingStatus用法及代碼示例
- PHP WHMCS DomainGetNameservers用法及代碼示例
- PHP WHMCS DomainEdit用法及代碼示例
- PHP WHMCS DomainUpdateNameservers用法及代碼示例
- PHP WHMCS DomainWhois用法及代碼示例
- PHP WHMCS DomainRenew用法及代碼示例
- PHP WHMCS DomainRegister用法及代碼示例
- PHP WHMCS DomainRelease用法及代碼示例
- PHP WHMCS DomainRequestEPP用法及代碼示例
- PHP WHMCS DomainGetLockingStatus用法及代碼示例
- PHP Ds\Map isEmpty()用法及代碼示例
- PHP DOMDocument createElementNS()用法及代碼示例
- PHP Ds\Deque filter()用法及代碼示例
- PHP DOMNode normalize()用法及代碼示例
- PHP DOMElement getAttribute()用法及代碼示例
- PHP WHMCS DeleteQuote用法及代碼示例
- PHP Ds Deque rotate()用法及代碼示例
- PHP DOMElement setAttributeNode()用法及代碼示例
注:本文由純淨天空篩選整理自whmcs.com大神的英文原創作品 DomainToggleIdProtect。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。