createacct
Create Account
This is to create an eenos hosting account .account. You can also create thea hosting account with reseller privileges.
Required Parameters
These parameters are mandatory ,mandatory, or else you will receive 400 error code.
Filed | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
domain | Client's main website name | myclientsite.com |
user | A user name for eenos account | myclient |
Contact email address of the client | contact@myclientsite.com | |
package | Hosting plan or package name | Bronze |
Optional Parameters
Description | Example | |
password | A password for |
changeme |
language | The language code for the eenos control panel, default is 'en' | en |
theme | If you have a custom theme |
default |
mailserver | Use local or remote mail |
local |
dkim | To enable |
off |
spf | To enable |
off |
reseller | To make this account |
on |
resellerself | on | |
use_registrar_ns | To use domain registrar NS |
on |
ipv4 | To enable dedicated |
off |
ipv6 | To enable dedicated IPv6, values accepted 'off' or 'on'. This will override the package feature | off |
shell | To enable jailshell |
off |
reseller_bandwidth |
Reseller combined bandwidth |
unlimited |
reseller_limt | Number of accounts reseller can |
10 |
reseller_quota | Reseller combined disk |
20000 |
addondomains | Number of addon |
unlimited |
parkeddomains | limit of Domain |
10 |
subdomains | Number of |
100 |
email_accounts | Number of email |
150 |
ftp | Number of ftp |
10 |
sql | Number of |
unlimited |
bandwidth | Hosting account |
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 | |
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_URL \
-d "apiuser=eenos_api" \
-d "apiauth=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 request url
request_url='/createacct/'
# The server api base url
base_url='https://your-host-name:5555/api'
# Default base url
# base_url='https://your-host-name:5555/api'
# Version specific base url
# base_url='https://your-host-name:5555/api/v1'
# The api url
api_ulr=base_url+request_url
# The data in dictionary format
data={
'apiuser': 'eenos_api',
'apiauth':'eenos123',
'domain':'myclientsite.com',
'user':'myclient',
'email':'contact@myclientsite.com',
'package':'Brownse'
}
try:
result=requests.post(api_ulr, data = data)
pprint(result.json())
except Exception as e:
pprint(str(e))
pass
PHP Code
<?php
// The API request url
$request_url='/createacct/';
// Your server API base url
$base_url='https://your-host-name:5555/api';
// Default base url
// $base_url='https://your-host-name:5555/api';
// Version specific base url
// $base_url='https://your-host-name:5555/api/v1';
// The FULL API URL
$api_url=$base_url.$request_url;
//The data you want to send via POST
$fields= [
'apiuser' => 'eenos_api',
'apiauth' => 'eenos123',
'domain' => 'myclientsite.com',
'user' => 'myclient',
'email' => 'contact@myclientsite.com',
'package' => 'Brownse'
];
//url-ify the data for the POST
$fields_string = http_build_query($fields);
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $api_url);
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
//So that curl_exec returns the contents of the cURL; rather than echoing it
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
//execute post
$result = curl_exec($ch);
//Print the json result
echo json_encode(json_decode($result), JSON_PRETTY_PRINT);
?>