curl --request POST \
--url https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'token: <token>' \
--header 'username: <username>' \
--data domain=example.com \
--data ns1=ns1.example.com \
--data ns2=ns2.example.com \
--data 'ns3=<string>' \
--data 'ns4=<string>' \
--data 'ns5=<string>'import requests
url = "https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers"
payload = {
"domain": "example.com",
"ns1": "ns1.example.com",
"ns2": "ns2.example.com",
"ns3": "<string>",
"ns4": "<string>",
"ns5": "<string>"
}
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({
domain: 'example.com',
ns1: 'ns1.example.com',
ns2: 'ns2.example.com',
ns3: '<string>',
ns4: '<string>',
ns5: '<string>'
})
};
fetch('https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "domain=example.com&ns1=ns1.example.com&ns2=ns2.example.com&ns3=%3Cstring%3E&ns4=%3Cstring%3E&ns5=%3Cstring%3E",
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"
payload := strings.NewReader("domain=example.com&ns1=ns1.example.com&ns2=ns2.example.com&ns3=%3Cstring%3E&ns4=%3Cstring%3E&ns5=%3Cstring%3E")
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")
.header("username", "<username>")
.header("token", "<token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("domain=example.com&ns1=ns1.example.com&ns2=ns2.example.com&ns3=%3Cstring%3E&ns4=%3Cstring%3E&ns5=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers")
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 = "domain=example.com&ns1=ns1.example.com&ns2=ns2.example.com&ns3=%3Cstring%3E&ns4=%3Cstring%3E&ns5=%3Cstring%3E"
response = http.request(request)
puts response.read_body{}{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}Save Nameservers
Updates the domain’s nameservers. ns1 and ns2 are required, ns3 through ns5 are optional.
curl --request POST \
--url https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'token: <token>' \
--header 'username: <username>' \
--data domain=example.com \
--data ns1=ns1.example.com \
--data ns2=ns2.example.com \
--data 'ns3=<string>' \
--data 'ns4=<string>' \
--data 'ns5=<string>'import requests
url = "https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers"
payload = {
"domain": "example.com",
"ns1": "ns1.example.com",
"ns2": "ns2.example.com",
"ns3": "<string>",
"ns4": "<string>",
"ns5": "<string>"
}
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({
domain: 'example.com',
ns1: 'ns1.example.com',
ns2: 'ns2.example.com',
ns3: '<string>',
ns4: '<string>',
ns5: '<string>'
})
};
fetch('https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "domain=example.com&ns1=ns1.example.com&ns2=ns2.example.com&ns3=%3Cstring%3E&ns4=%3Cstring%3E&ns5=%3Cstring%3E",
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"
payload := strings.NewReader("domain=example.com&ns1=ns1.example.com&ns2=ns2.example.com&ns3=%3Cstring%3E&ns4=%3Cstring%3E&ns5=%3Cstring%3E")
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")
.header("username", "<username>")
.header("token", "<token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("domain=example.com&ns1=ns1.example.com&ns2=ns2.example.com&ns3=%3Cstring%3E&ns4=%3Cstring%3E&ns5=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/nameservers")
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 = "domain=example.com&ns1=ns1.example.com&ns2=ns2.example.com&ns3=%3Cstring%3E&ns4=%3Cstring%3E&ns5=%3Cstring%3E"
response = http.request(request)
puts response.read_body{}{
"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
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.
"YTk4YjRmNjI..."
Path Parameters
Domain name (e.g. example.com)
"example.com"
Body
Domain name
"example.com"
First nameserver (required)
"ns1.example.com"
Second nameserver (required)
"ns2.example.com"
Third nameserver (optional)
Fourth nameserver (optional)
Fifth nameserver (optional)
Response
Success
The response is of type object.