將 Save Nameservers 命令發送到域的注冊商
連接到注冊商並嘗試使用提供的名稱服務器更新名稱服務器。
請求參數
參數 | 類型 | 說明 | 必需的 |
---|---|---|---|
action | string | “DomainUpdateNameservers” | Required |
domainid | int | 用於更新recommended 的名稱服務器的域 ID |
Optional |
domain | string | 要為其更新名稱服務器的域名。這個或 $domainid 是必需的 | Optional |
ns1 | string | 第一個域名服務器 | Required |
ns2 | string | 第二個域名服務器 | Required |
ns3 | string | 第三個域名服務器 | Optional |
ns4 | string | 第四個域名服務器 | Optional |
ns5 | string | 第五個域名服務器 | 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' => 'DomainUpdateNameservers',
// See https://developers.whmcs.com/api/authentication
'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',
'password' => 'SECRET_OR_HASHED_PASSWORD',
'domainid' => '1',
'responsetype' => 'json',
)
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
示例請求(本地 API)
$command = 'DomainUpdateNameservers';
$postData = array(
'domainid' => '1',
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later
$results = localAPI($command, $postData, $adminUsername);
print_r($results);
示例響應 JSON
{
"result": "success"
}
錯誤響應
可能的錯誤條件響應包括:
- 未找到域 ID
- 需要 ns1 和 ns2
- 注冊商錯誤消息
相關用法
- PHP WHMCS DomainUpdateWhoisInfo用法及代碼示例
- PHP WHMCS DomainUpdateLockingStatus用法及代碼示例
- PHP WHMCS DomainGetWhoisInfo用法及代碼示例
- PHP WHMCS DomainToggleIdProtect用法及代碼示例
- PHP WHMCS DomainTransferFailed用法及代碼示例
- PHP WHMCS DomainDelete用法及代碼示例
- PHP WHMCS DomainValidation用法及代碼示例
- PHP WHMCS DomainGetNameservers用法及代碼示例
- PHP WHMCS DomainTransfer用法及代碼示例
- PHP WHMCS DomainEdit用法及代碼示例
- PHP WHMCS DomainTransferCompleted用法及代碼示例
- 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大神的英文原創作品 DomainUpdateNameservers。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。