createacct
Create Account
This is to create an eenos hosting account. You can also create a hosting account with reseller privileges.
Required Headers
| Field | Description | Example |
| X-API-USER | API user name | eenos_api |
| X-API-PASSWORD | API user password | eenos123 |
Required Parameters
These parameters are mandatory, or else you will receive a 400 error code.
| Field | Description | Example |
| domain | Client's main website name | myclientsite.com |
| user | A username for eenos account | myclient |
| Contact email address of the client | contact@myclientsite.com | |
| package | Hosting plan or package name | Bronze |
Optional Parameters
| Field | Description | Example |
| password | A password for Eenos login will be auto-generated if not given | changeme |
| language | The language code for the eenos control panel, default, is 'en' | en |
| theme | If you have a custom theme name, the default theme is 'default' | default |
| mailserver | Use a local or remote mail server, default 'local' | local |
| dkim | To enable DKIM, values are accepted as 'off' or 'on' | off |
| spf | To enable SPF, the accepted values are 'off' or 'on' | off |
| reseller | To make this account a reseller, accepted values are 'off' or 'on' | on |
| resellerself | Self-own accounts in case of reseller, values accepted 'off' or 'on' | on |
| use_registrar_ns | To use domain registrar NS records, accepted values are 'off' or 'on' | on |
| ipv4 | To enable dedicated IPv4, the accepted values are 'off' or 'on'. This will override the package feature | off |
| ipv6 | To enable dedicated IPv6, the accepted values are 'off' or 'on'. This will override the package feature | off |
| shell | To enable jailshell access, the accepted values are 'off' or 'on | off |
| reseller_bandwidth |
Reseller combined bandwidth limit. Values accepted unlimited or number (MB) |
unlimited |
| reseller_limt | Number of accounts a reseller can create, values accepted unlimited or number | 10 |
| reseller_quota | Reseller combined disk quota, values accepted unlimited or number (MB) | 20000 |
| addondomains | Number of addon domains, values accepted unlimited or number | unlimited |
| parkeddomains | limit of Domain parking, values accepted unlimited or number | 10 |
| subdomains | Number of subdomains, values accepted: unlimited or a number | 100 |
| email_accounts | Number of email accounts, values accepted unlimited or number | 150 |
| ftp | Number of ftp accounts, values accepted: unlimited or number | 10 |
| sql | Number of databases, values accepted unlimited or number | unlimited |
| bandwidth | Hosting account bandwidth limit, values accepted unlimited or number (MB) | 50000 |
| quota | Hosting account disk quota, values accepted unlimited or number (MB) | 10000 |
| mailquota | Hosting account default email quota, values accepted unlimited or number (MB) | 512 |
Result Status Codes
| Status Code | Description |
| 200 | Success |
| 500 | Server Error |
| 403 | Forbidden, demo server |
| 400 | Bad data request |
Request URL
Post url = /createacct/
Full URL = https://your-host-name:5555/api/createacct/
Curl Code
#!/bin/bash
REQUEST_URL="/createacct/"
BASE_URL="https://your-host-name:5555/api/v1"
API_URL="$BASE_URL$REQUEST_URL"
/usr/bin/curl -X POST "$API_URLAPI_URL" \
-dH "apiuser=X-API-USER: eenos_api" \
-dH "apiauth=X-API-PASSWORD: eenos123" \
-d "domain=myclientsite.com" \
-d "user=myclient" \
-d "email=contact@myclientsite.com" \
-d "package=Brownse"
Sample Output
{'data': {'addondomains': 'unlimited',
'bandwidth': 'unlimited',
'contactemail': 'contact@myclientsite.com',
'dedicatedip': {'ipv4': 'xxx.xx.xx.xxx',
'ipv6': '2a01:0xxx:0xxx:2xxx:0000:0000:0000:xxxx',
'status': 'off',
'status6': 'off'},
'dkim': 'off',
'domain': 'myclientsite.com',
'email': 'unlimited',
'feature': 'Default',
'ftp': 'unlimited',
'homedir': '/home/myclient',
'language': 'en',
'maillist': 'unlimited',
'mailquota': 'unlimited',
'mailserver': 'local',
'nameservers': ['ns1.eenos.com', 'ns2.eenos.com'],
'owner': 'root',
'package': 'Brownse',
'parkeddomains': 'unlimited',
'quota': 'unlimited',
'reseller': {'selfown': 'off', 'status': 'off'},
'setuptime': '2022-12-12 07:47',
'shell': {'shell': '/sbin/nologin', 'status': 'off'},
'spf': 'off',
'sql': 'unlimited',
'subdomains': 'unlimited',
'theme': 'default',
'user': 'myclient'},
'info': 'Hosting account created successfully',
'status': 200}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The---------------------------------------------------------------------
# API requestVERSION url
request_url='/createacct/'RULES
# The server api base url
base_url='https://your-host-name:5555/api'---------------------------------------------------------------------
# Default baseAPI url(stable):
# base_url='https://your-host-name:5555/api'
# Version specific base url
# base_url='https://your-host-name:5555/api/v1'
#
The# apiVersioned urlAPI api_ulr=base_url+request_url(recommended for production / future compatibility):
# Thehttps://your-host-name:5555/api/v1/
#
# Endpoint example (account creation):
# createacct/
# Full versioned URL:
# https://your-host-name:5555/api/v1/createacct/
#
# Use versioned endpoints when API structure may change across releases.
# ---------------------------------------------------------------------
# API URL (versioned)
api_url = "https://your-host-name:5555/api/v1/createacct/"
# If using default API, uncomment below:
# api_url = "https://your-host-name:5555/api/createacct/"
# Authentication headers (new API format)
headers = {
"X-API-USER": "eenos_api",
"X-API-PASSWORD": "eenos123",
}
# Payload data
indata dictionary= format
data={
'apiuser'"domain": 'eenos_api'"myclientsite.com",
'apiauth'"user":'eenos123' "myclient",
'domain'"email":'myclientsite.com' "contact@myclientsite.com",
'user'"package":'myclient', 'email':'contact@myclientsite.com',
'package':'Brownse'"Brownse"
}
try:
result=requests.post(api_ulr, dataresponse = requests.post(api_url, headers=headers, data=data)
response.raise_for_status()
pprint(result.response.json())
except Exception as e:
pprint(str(e))
pass
PHP Code
<?php
/*
|--------------------------------------------------------------------------
| API VERSION RULES
|--------------------------------------------------------------------------
| Default API (stable):
| https://your-host-name:5555/api/
|
| Versioned API (recommended for production / Thefuture compatibility):
| https://your-host-name:5555/api/v1/
|
| Endpoint example (account creation):
| createacct/
| Full versioned URL:
| https://your-host-name:5555/api/v1/createacct/
|
| Use versioned endpoints when API structure may change across releases.
|--------------------------------------------------------------------------
*/
// API request urlURL (versioned)
$request_url=request_url = '/createacct/';
/*
|--------------------------------------------------------------------------
| BASE URL SELECTION
|--------------------------------------------------------------------------
*/
Your// serverVersioned API base urlURL
$base_url='https://your-host-name:5555/api';base_url //= Default base url
// $base_url='https://your-host-name:5555/api';
// Version specific base url
// $base_url='https://your-host-name:5555/api/v1';
// TheDefault FULLAPI base URL (uncomment if needed)
// $base_url = 'https://your-host-name:5555/api';
// Full API URL
$api_url=api_url = $base_url.base_url . $request_url;
//The data you want to send via POST payload
$fields=fields = [
'apiuser' => 'eenos_api',
'apiauth' => 'eenos123',
'domain' => 'myclientsite.com',
'user' => 'myclient',
'email' => 'contact@myclientsite.com',
'package' => 'Brownse'
];
//url-ify theInitialize data for the POST
$fields_string = http_build_query($fields);
//open connectioncURL
$ch = curl_init()$api_url);
//set theSet url, number of POST vars, POST dataoptions
curl_setopt($ch,CURLOPT_URL, $api_url);
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields_string)fields));
//So that curl_exec returns the contents of the cURL; rather than echoing it
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//execute postAuthentication headers (new API format)
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-USER: eenos_api',
'X-API-PASSWORD: eenos123'
]);
// Execute request
$result = curl_exec($ch);
//Print theError jsonhandling
resultif (curl_errno($ch)) {
echo 'cURL Error: ' . curl_error($ch);
} else {
echo json_encode(json_decode($result), JSON_PRETTY_PRINT);
}
// Close connection
curl_close($ch);
?>