Save Email Forwarding
curl --request POST \
--url https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/email \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'token: <token>' \
--header 'username: <username>' \
--data domain=example.com \
--data-urlencode prefix%5B0%5D=info \
--data-urlencode prefix%5B1%5D=contact \
--data-urlencode forwardto%5B0%[email protected] \
--data-urlencode forwardto%5B1%[email protected]import requests
url = "https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/email"
payload = {
"domain": "example.com",
"prefix[0]": "info",
"prefix[1]": "contact",
"forwardto[0]": "[email protected]",
"forwardto[1]": "[email protected]"
}
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',
'prefix[0]': 'info',
'prefix[1]': 'contact',
'forwardto[0]': '[email protected]',
'forwardto[1]': '[email protected]'
})
};
fetch('https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/email', 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}/email",
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&prefix%5B0%5D=info&prefix%5B1%5D=contact&forwardto%5B0%5D=info%40gmail.com&forwardto%5B1%5D=contact%40gmail.com",
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}/email"
payload := strings.NewReader("domain=example.com&prefix%5B0%5D=info&prefix%5B1%5D=contact&forwardto%5B0%5D=info%40gmail.com&forwardto%5B1%5D=contact%40gmail.com")
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}/email")
.header("username", "<username>")
.header("token", "<token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("domain=example.com&prefix%5B0%5D=info&prefix%5B1%5D=contact&forwardto%5B0%5D=info%40gmail.com&forwardto%5B1%5D=contact%40gmail.com")
.asString();require 'uri'
require 'net/http'
url = URI("https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/email")
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&prefix%5B0%5D=info&prefix%5B1%5D=contact&forwardto%5B0%5D=info%40gmail.com&forwardto%5B1%5D=contact%40gmail.com"
response = http.request(request)
puts response.read_body{
"success": "success"
}{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}{
"error": "Invalid API Token provided"
}Email
Save Email Forwarding
Saves or updates the email forwarding rules for the domain. The prefix and forwardto arrays correspond by index.
POST
/
domains
/
{domain}
/
email
Save Email Forwarding
curl --request POST \
--url https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/email \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'token: <token>' \
--header 'username: <username>' \
--data domain=example.com \
--data-urlencode prefix%5B0%5D=info \
--data-urlencode prefix%5B1%5D=contact \
--data-urlencode forwardto%5B0%[email protected] \
--data-urlencode forwardto%5B1%[email protected]import requests
url = "https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/email"
payload = {
"domain": "example.com",
"prefix[0]": "info",
"prefix[1]": "contact",
"forwardto[0]": "[email protected]",
"forwardto[1]": "[email protected]"
}
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',
'prefix[0]': 'info',
'prefix[1]': 'contact',
'forwardto[0]': '[email protected]',
'forwardto[1]': '[email protected]'
})
};
fetch('https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/email', 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}/email",
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&prefix%5B0%5D=info&prefix%5B1%5D=contact&forwardto%5B0%5D=info%40gmail.com&forwardto%5B1%5D=contact%40gmail.com",
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}/email"
payload := strings.NewReader("domain=example.com&prefix%5B0%5D=info&prefix%5B1%5D=contact&forwardto%5B0%5D=info%40gmail.com&forwardto%5B1%5D=contact%40gmail.com")
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}/email")
.header("username", "<username>")
.header("token", "<token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("domain=example.com&prefix%5B0%5D=info&prefix%5B1%5D=contact&forwardto%5B0%5D=info%40gmail.com&forwardto%5B1%5D=contact%40gmail.com")
.asString();require 'uri'
require 'net/http'
url = URI("https://vicem.com/modules/addons/DomainsReseller/api/index.php/domains/{domain}/email")
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&prefix%5B0%5D=info&prefix%5B1%5D=contact&forwardto%5B0%5D=info%40gmail.com&forwardto%5B1%5D=contact%40gmail.com"
response = http.request(request)
puts response.read_body{
"success": "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
Domain name
Example:
"example.com"
Array of address prefixes (part before the @)
Example:
["info", "contact"]
Array of destination email addresses (matches prefix by index)
Example:
Response
Success
Example:
"success"
⌘I