Modify Nameserver
curl --request POST \
--url https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'token: <token>' \
--header 'username: <username>' \
--data nameserver=ns1.example.com \
--data currentipaddress=192.0.2.1 \
--data newipaddress=192.0.2.2import requests
url = "https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify"
payload = {
"nameserver": "ns1.example.com",
"currentipaddress": "192.0.2.1",
"newipaddress": "192.0.2.2"
}
headers = {
"username": "<username>",
"token": "<token>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
username: '<username>',
token: '<token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
nameserver: 'ns1.example.com',
currentipaddress: '192.0.2.1',
newipaddress: '192.0.2.2'
})
};
fetch('https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "nameserver=ns1.example.com¤tipaddress=192.0.2.1&newipaddress=192.0.2.2",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded",
"token: <token>",
"username: <username>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify"
payload := strings.NewReader("nameserver=ns1.example.com¤tipaddress=192.0.2.1&newipaddress=192.0.2.2")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("username", "<username>")
req.Header.Add("token", "<token>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify")
.header("username", "<username>")
.header("token", "<token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("nameserver=ns1.example.com¤tipaddress=192.0.2.1&newipaddress=192.0.2.2")
.asString();require 'uri'
require 'net/http'
url = URI("https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["username"] = '<username>'
request["token"] = '<token>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "nameserver=ns1.example.com¤tipaddress=192.0.2.1&newipaddress=192.0.2.2"
response = http.request(request)
puts response.read_body"success"{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}Nameservers
Modify Nameserver
Modifies the IP address of an existing nameserver. Returns "success" on success.
POST
/
domains
/
{domain}
/
nameservers
/
modify
Modify Nameserver
curl --request POST \
--url https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'token: <token>' \
--header 'username: <username>' \
--data nameserver=ns1.example.com \
--data currentipaddress=192.0.2.1 \
--data newipaddress=192.0.2.2import requests
url = "https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify"
payload = {
"nameserver": "ns1.example.com",
"currentipaddress": "192.0.2.1",
"newipaddress": "192.0.2.2"
}
headers = {
"username": "<username>",
"token": "<token>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
username: '<username>',
token: '<token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
nameserver: 'ns1.example.com',
currentipaddress: '192.0.2.1',
newipaddress: '192.0.2.2'
})
};
fetch('https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "nameserver=ns1.example.com¤tipaddress=192.0.2.1&newipaddress=192.0.2.2",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded",
"token: <token>",
"username: <username>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify"
payload := strings.NewReader("nameserver=ns1.example.com¤tipaddress=192.0.2.1&newipaddress=192.0.2.2")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("username", "<username>")
req.Header.Add("token", "<token>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify")
.header("username", "<username>")
.header("token", "<token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("nameserver=ns1.example.com¤tipaddress=192.0.2.1&newipaddress=192.0.2.2")
.asString();require 'uri'
require 'net/http'
url = URI("https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers/modify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["username"] = '<username>'
request["token"] = '<token>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "nameserver=ns1.example.com¤tipaddress=192.0.2.1&newipaddress=192.0.2.2"
response = http.request(request)
puts response.read_body"success"{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}Headers
Reseller email address registered in WHMCS
Example:
HMAC-SHA256 authentication token.
PHP formula: base64_encode(hash_hmac('sha256', $apiKey, $email . ':' . gmdate('y-m-d H')))
Important: hash_hmac without the 3rd parameter true (returns hex, not binary), then base64_encode of the hex result. The token is 88 characters long.
An optional timestamp header (Unix timestamp, 60-second tolerance) can be sent to synchronize time.
Example:
"YTk4YjRmNjI..."
Path Parameters
Domain name (e.g. example.com)
Example:
"example.com"
Body
application/x-www-form-urlencoded
Response
Success
The response is of type string.
Example:
"success"
⌘I