Save Registrar Lock
curl --request POST \
--url https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/lock \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'token: <token>' \
--header 'username: <username>' \
--data domain=example.com \
--data lockstatus=lockedimport requests
url = "https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/lock"
payload = {
"domain": "example.com",
"lockstatus": "locked"
}
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', lockstatus: 'locked'})
};
fetch('https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/lock', 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}/lock",
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&lockstatus=locked",
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}/lock"
payload := strings.NewReader("domain=example.com&lockstatus=locked")
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}/lock")
.header("username", "<username>")
.header("token", "<token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("domain=example.com&lockstatus=locked")
.asString();require 'uri'
require 'net/http'
url = URI("https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/lock")
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&lockstatus=locked"
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"
}Domains
Save Registrar Lock
Enables or disables the domain transfer lock. Value locked locks the domain, any other value unlocks it.
POST
/
domains
/
{domain}
/
lock
Save Registrar Lock
curl --request POST \
--url https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/lock \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'token: <token>' \
--header 'username: <username>' \
--data domain=example.com \
--data lockstatus=lockedimport requests
url = "https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/lock"
payload = {
"domain": "example.com",
"lockstatus": "locked"
}
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', lockstatus: 'locked'})
};
fetch('https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/lock', 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}/lock",
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&lockstatus=locked",
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}/lock"
payload := strings.NewReader("domain=example.com&lockstatus=locked")
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}/lock")
.header("username", "<username>")
.header("token", "<token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("domain=example.com&lockstatus=locked")
.asString();require 'uri'
require 'net/http'
url = URI("https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/lock")
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&lockstatus=locked"
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
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 - Registrar result
The response is of type object.
⌘I