API
Eenos Hosting Control Panel API documentation is for integrating billing software and other external applications to automate account provisioning on an eenos server.
- WAP API
- Introduction
- Create API Logins
- Connect and Test API Login
- test_connection
- load-average
- version
- createacct
- passwd
- editquota
- changepackage
- changecontactemail
- suspendacct
- unsuspendacct
- removeacct
- setupreseller
- uappsso
- wapsso
- rappsso
- suspendreseller
- unsuspendreseller
- terminatereseller
- get_current_users_count
- get_current_reseller_count
- listsuspended
- accountsummary
- listaccts
- listpackages
- usagestatistics
- EAPI
WAP API
This API is used to manage and automate the provisioning of Eenos accounts and related tasks.
Introduction
What is WAP API?
This API is used to manage eenos accounts and resellers. You may use this documentation to integrate the Eenos hosting control panel into your billing system or other remote management services.
The eenos API is a Rest framework to manage requests. You can send the requests using your favorite programming language or curl command.
Main Components of API URL
The API URL has two parts,
- Data Part
- Post URL part
Data Part
The data part contains the data sent to the API URL. Every data part needs to have some parameters that are required to authenticate with the API servers. Those are
apiuser - The user name of the API
apiauth - The password of the API user
Every API Request needs apiuser and apiauth parameters to operate.
Post URL
This API URL operates the API request. Eenos has a unique API url for every operation. There are two types of API URLs. The default url and version-based url.
Example, Default URL: https://your-host-name:5555/api/
Example, Version url: https://your-host-name:5555/api/v1/
Every API Request needs the API URL to perform the requested task.
Default URL
This API URL uses the default api version provided by the server. At this time, the default url is version 1.
Version URL
This is to perform operations on a specific API version of the eenos control panel. At this time, we have version 1 url.
Response & Output
The result from the API requests will be in Json data format which will have three parts.
- data
- info
- status
data
The data json dictionary will contain the data performed after api operation.
info
This field provides information about the API.
status
This field provides the operation status code. If the status code is 200, then the operation is a success. Some other codes will be provided in the coming api document with every operation.
Example
The following example shows, how to send an API request to Eenos WAP Admin.
We are using the following data,
apiuser=eenos_api
apiauth=eenos123
URL = https://dev.eenos.com:5555/api/load-average/
Sample CURL Command on Default API Url
curl -X POST -d "apiuser=eenos_api&apiauth=eenos123" https://dev.eenos.com:5555/api/load-average/
Sample CURl Command on Version API URl, v1
curl -X POST -d "apiuser=eenos_api&apiauth=eenos123" https://dev.eenos.com:5555/api/v1/load-average/
Output
{"data":{"load_average":"0.55 0.51 0.46"},"info":"Current server load","status":200}
The above API request will retrieve the server Load Average.
Authentication Errors
The API requests will show two types of authentication errors.
- Authentication credentials were not provided
- You do not have permission to perform this action.
Authentication credentials were not provided
As the message shows, you need to send apiuser and apiauth to operate.
You do not have permission to perform this action.
You may use the wrong apiuser name and apiauth, or your IP has restrictions for accessing the API using the given api login credentials.
Create API Logins
Manage API Access
This document explains how to create API logins ( apiuser and apiauth ) from the WAP portal. You may login to the WAP portal with your root logins on port 5555.
Create API User and Password
Go to Preferences >> API Manager
Go to Create API Account
Now enter the API User Name and password, Re-enter Password, and Select the Remote Access Options.
API User Name - A user name for the API which we will use with the apiuser
Password - A password for the API user, which we will use with the apiauth
Remote Access Options - If you like to allow the api user to connect from any IP, you can choose to Allow any IP. If you like to restrict access from certain IPs, you can enter the restricted IPs by selecting Allow the following IPs Only.
Allowing Any IP is called Open Access.
Restricting the access by IP is called Restricted Remote Access. It is recommended to connect via secured IPs.
After creating the API user account, you may need to store the api password to a secured location. You can't retrieve the API password once created. You can only reset the password.
The API passwords are stored in the UNIX password hash format.
Connect and Test API Login
Now Test The API Logins
From the previous page you created, an api account on your WAP control panel. We are not testing the API connection using that api user credentials.
Let's use the following example api user credentials to demonstrate the api login.
Request Data
apiuser=eenos_api, you should use the created api username
apiauth=eenos123, you should use the password of the api user
API URL = https://your-host-name:5555/api/
Sample Curl Command
curl -X POST -d "apiuser=eenos_api&apiauth=eenos123" https://your-host-name:5555/api/
Output:
{"username":"eenos_api","auth":"API"}
If you can see a similar result like below, your API logins are ok and working. If you got any other error message, then you are using the wrong api logins or there is an error in connecting from your IP.
Python Code
import requests
from pprint import pprint
# The api url
api_ulr=' https://your-host-name:5555/api/'
# The data in dictionary format
data={
'apiuser': 'eenos_api',
'apiauth':'eenos123'
}
try:
result=requests.post(api_ulr, data = data)
pprint(result.json())
except Exception as e:
pprint(str(e))
pass
PHP Code
<?php
// The API URL
$url='https://your-host-name:5555/api/';
//The data you want to send via POST
$fields= [
'apiuser' => 'eenos_api',
'apiauth' => 'eenos123'
];
//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, $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);
echo $result;
?>
test_connection
Test API Connection
This function is to test the API connection to the server via api request itself.
Request Data
apiuser=eenos_api, you should use the created api username
apiauth=eenos123, you should use the password of the api user
API URL = https://your-host-name:5555/api//test_connection/
Request URL
Post URL = /test_connection/
Full URL = https://your-host-name:5555/api/test_connection/
Example Curl Command
curl -X POST -d "apiuser=eenos_api&apiauth=eenos123" https://your-host-name:5555/api/test_connection/
Output:
{"data":{"test":"Connection Success"},"info":"API Connection Success","status":200}
If you can see a similar result like below, your API logins are ok and working. If you got any other error message, then you are using the wrong api logins or there is an error in connecting from your IP.
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/test_connection/'
# 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',
'user':'myclient',
'selfown':'on'
}
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='/test_connection/';
// 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',
'user' => 'myclient',
'selfown' => 'on'
];
//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);
?>
load-average
Load Average
This is to get the server load average via API.
Required Parameters
Field | Description | Example |
apiuser | The API username | eenos_api |
apiauth | The API user password | eenos123 |
Request URL
Post URL = /load-average/
Full URL = https://your-host-name:5555/api/load-average/
Example CURL Command
curl -X POST -d "apiuser=eenos_api&apiauth=eenos123" https://your-host-name:5555/api/load-average/
Output
{'data': {'load_average': '0.23 0.41 0.37'},
'info': 'Current server load',
'status': 200}
Python Code
import requests
from pprint import pprint
# The api url
api_ulr='https://your-host-name:5555/api/load-average/'
# The data in dictionary format
data={
'apiuser': 'eenos_api',
'apiauth':'eenos123'
}
try:
result=requests.post(api_ulr, data = data)
pprint(result.json())
except Exception as e:
pprint(str(e))
pass
PHP Code
<?php
// The API URL
$url='https://your-host-name:5555/api/load-average/';
//The data you want to send via POST
$fields= [
'apiuser' => 'eenos_api',
'apiauth' => 'eenos123'
];
//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, $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);
echo $result;
?>
version
Eenos version
Get the version of the Eenos control panel from your server
Required Parameters
Field | Description | Example |
apiuser | The API username | eenos_api |
apiauth | The API user password | eenos123 |
Request URL
Post URL = /version/
Full URL = https://your-host-name:5555/api/version/
Example CURL Command
curl -X POST -d "apiuser=eenos_api&apiauth=eenos123" https://your-host-name:5555/api/version/
Output
{
"data": {
"version": "0.1.1-RELEASE",
"version_code": "0.1.1"
},
"info": "Eenos Version",
"status": 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/version/'
# 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',
}
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='/version/';
// 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',
];
//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);
?>
createacct
Create Account
This is to create an eenos hosting account. You can also create a hosting account with reseller privileges.
Required Parameters
These parameters are mandatory, or else you will receive 400 error code.
Field | 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
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 local or remote mail server, default 'local' | local |
dkim | To enable dkim, values accepted 'off' or 'on' | off |
spf | To enable spf, values accepted 'off' or 'on' | off |
reseller | To make this account reseller, accepted values '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 'off' or 'on' | on |
ipv4 | To enable dedicated IPv4, values accepted 'off' or 'on'. This will override the package feature | off |
ipv6 | To enable dedicated IPv6, values accepted 'off' or 'on'. This will override the package feature | off |
shell | To enable jailshell access, values accepted 'off' or 'on | off |
reseller_bandwidth |
Reseller combined bandwidth limit. Values accepted unlimited or number (MB) |
unlimited |
reseller_limt | Number of accounts 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 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_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);
?>
passwd
Password Change API
Change the Eenos user account password.
Required Parameters
Field | Description | Example |
apiuser | The API username | eenos_api |
apiauth | The API user password | eenos123 |
user | The eenos account username | myclient |
Optional Parameters
Field | Description | Example |
password | A new password, if not given a random password will be used | newpassword |
Result Status Codes
Status Code | Description |
200 | OK, Success |
500 | Server error |
403 | Forbidden, demo server |
400 | Bad request or bad data |
Request URL
Post url = /passwd/
Full URL = https://your-host-name:5555/api/passwd/
Curl Code
#!/bin/bash
REQUEST_URL="/passwd/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient" \
-d "password=newpassword"
Sample Output
{
"data" : "User password changed for myclient",
"info" : "Hosting account password changed successfully",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/passwd/'
# 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',
}
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='/passwd/';
// 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',
'user' => 'myclient',
];
//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);
?>
editquota
Edit Disk Quota
To change the disk quota of a hosting account.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | eenos account user name | myclient |
quota | Quota in MB or "unlimited" | 1024 |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad Request or bad data |
Request URL
Post url = /editquota/
Default Full URL = https://your-host-name:5555/api/editquota/
Version Full URL = https://your-host-name:5555/api/v1/editquota/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/editquota/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient" \
-d "quota=1024"
Sample Output
{
"data" : "User disk quota changed for myclient",
"info" : "Hosting account disk quota changed successfully",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/editquota/'
# 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',
'user':'myclient',
'quota':1024
}
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='/editquota/';
// 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',
'user' => 'myclient',
'quota' => 1024
];
//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);
?>
changepackage
Change Hosting Package
To change the hosting plan or package of an eenos account
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | eenos account user name | myclient |
package | Package name | Gold |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad data or bad request |
Request URL
Post url = /changepackage/
Default Full URL = https://your-host-name:5555/api/changepackage/
Version Full URL = https://your-host-name:5555/api/v1/changepackage/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/changepackage/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient" \
-d "package=Gold"
Sample Output
{
"data" : "User hosting package changed for myclient",
"info" : "Hosting account package changed successfully",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/changepackage/'
# 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',
'user':'myclient',
'package':'Gold'
}
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='/changepackage/';
// 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',
'user' => 'myclient',
'package' => 'Gold'
];
//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);
?>
changecontactemail
Change Contact Email
To change the contact email address of an eenos hosting account
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | eenos account user name | myclient |
An email address | neweemail@myclientsite.com |
Status Codes
Code | Description |
200 | OK, Success |
400 | Server Error |
403 | Forbidden |
400 | Bad Request |
Request URL
Post url = /changecontactemail/
Default Full URL = https://your-host-name:5555/api/changecontactemail/
Version Full URL = https://your-host-name:5555/api/v1/changecontactemail/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/changecontactemail/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient" \
-d "email=neweemail@myclientsite.com"
Sample Output
{
"data" : "User contact email changed for myclient => neweemail@myclientsite.com",
"info" : "Hosting account contact email changed successfully",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/changecontactemail/'
# 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',
'user':'myclient',
'email':'neweemail@myclientsite.com'
}
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='/changecontactemail/';
// 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',
'user' => 'myclient',
'email' => 'neweemail@myclientsite.com'
];
//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);
?>
suspendacct
Suspend Eenos Account
To suspend an eenos hosting account via API.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | eenos account user name | myclient |
Optional Parameters
Field | Description | Example |
reason | Reason for suspension | non-payment |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /suspendacct/
Default Full URL = https://your-host-name:5555/api/suspendacct/
Version Full URL = https://your-host-name:5555/api/v1/suspendacct/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/suspendacct/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient" \
-d "reason='no payment'"
Sample Output
{
"data" : "User account suspended myclient",
"info" : "Hosting account suspended successfully",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/suspendacct/'
# 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',
'user':'myclient',
'reason':'non payment'
}
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='/suspendacct/';
// 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',
'user' => 'myclient',
'reason' => 'non payment'
];
//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);
?>
unsuspendacct
Un-suspend Eenos Account
To un-suspend an Eenos hosting account via API.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | eenos account user name | myclient |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /unsuspendacct/
Default Full URL = https://your-host-name:5555/api/unsuspendacct/
Version Full URL = https://your-host-name:5555/api/v1/unsuspendacct/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/unsuspendacct/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient"
Sample Output
{
"data" : "User account unsuspended myclient",
"info" : "Hosting account unsuspended successfully",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/unsuspendacct/'
# 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',
'user':'myclient',
}
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='/unsuspendacct/';
// 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',
'user' => 'myclient',
];
//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);
?>
removeacct
Delete Eenos Account
To remove an Eenos hosting account via API.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | eenos account user name | myclient |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /removeacct/
Default Full URL = https://your-host-name:5555/api/removeacct/
Version Full URL = https://your-host-name:5555/api/v1/removeacct/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/removeacct/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient"
Sample Output
{
"data" : "User account terminated myclient",
"info" : "Hosting account terminated successfully",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/removeacct/'
# 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',
'user':'myclient',
}
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='/removeacct/';
// 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',
'user' => 'myclient',
];
//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);
?>
setupreseller
Make Reseller
To enable reseller privileges on the hosting account.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | Eenos account user name | myclient |
Optional Parameters
Field | Description | Example |
selfown | Allow the reseller to own their account, accepted values 'on' or 'off' | on |
reseller_limt | Limit number of accounts, Values unlimited or number, Default unlimited | 100 |
reseller_bandwidth | Limit by bandwidth usage, Values unlimited or number, Default unlimited | unlimited |
reseller_quota | Limit by disk usage, Values unlimited or number, Default unlimited | 50000 |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /setupreseller/
Default Full URL = https://your-host-name:5555/api/setupreseller/
Version Full URL = https://your-host-name:5555/api/v1/setupreseller/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/setupreseller/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient" \
-d "selfown=on"
Sample Output
{
"data" : "User account converted to reseller myclient",
"info" : "Hosting account reseller privilege enabled successfully",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/setupreseller/'
# 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',
'user':'myclient',
'selfown':'on'
}
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='/setupreseller/';
// 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',
'user' => 'myclient',
'selfown' => 'on'
];
//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);
?>
uappsso
Eenos User Single Sign-On
To create a quick login url for the Eenos hosting account.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | eenos account user name | myclient |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /uappsso/
Default Full URL = https://your-host-name:5555/api/uappsso/
Version Full URL = https://your-host-name:5555/api/v1/uappsso/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/uappsso/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient"
Sample Output
{
"data" : {
"url" : "https://your-host-name:3333/quick/608e70a0e9fb3899d37305821df09969"
},
"info" : "Hosting account quick login url of myclient",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/uappsso/'
# 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',
'user':'myclient',
}
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='/uappsso/';
// 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',
'user' => 'myclient',
];
//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);
?>
wapsso
Single Sine-On for WAP
To create a quick SSO login url for the admin control panel of the Eenos.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | Wap login user | root |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /wapsso/
Default Full URL = https://your-host-name:5555/api/wapsso/
Version Full URL = https://your-host-name:5555/api/v1/wapsso/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/wapsso/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=root"
Sample Output
{
"data" : {
"url" : "https://your-host-name:5555/quick/608e70a0e9fb3899d37305821df09969"
},
"info" : "SSO Login url of Admin",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/wapsso/'
# 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',
'user':'root',
}
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='/wapsso/';
// 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',
'user' => 'root',
];
//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);
?>
rappsso
Reseller Single Sign-On
To generate a quick login url for the Eenos reseller account.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | eenos account reseller name | myclient |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /rappsso/
Default Full URL = https://your-host-name:5555/api/rappsso/
Version Full URL = https://your-host-name:5555/api/v1/rappssol/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/rappsso/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient"
Sample Output
{
"data" : {
"url" : "https://your-host-name:4444/quick/608e70a0e9fb3899d37305821df09969"
},
"info" : "Hosting account quick login url of myclient",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/rapsso/'
# 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',
'user':'myclient',
}
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='/rappsso/';
// 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',
'user' => 'myclient',
];
//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);
?>
suspendreseller
Suspend Eenos Reseller Account
To suspend eenos reseller hosting account via API.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | eenos reseller account user name | myclient |
Optional Parameters
Field | Description | Example |
reason | Reason for suspension | non-payment |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /suspendreseller/
Default Full URL = https://your-host-name:5555/api/suspendreseller/
Version Full URL = https://your-host-name:5555/api/v1/suspendreseller/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/suspendreseller/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient" \
-d "reason='no payment'"
Sample Output
{
"data" : "Reseller account suspended myclient",
"info" : "Hosting reseller account suspended successfully",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/suspendreseller/'
# 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',
'user':'myclient',
'reason':'non payment'
}
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='/suspendreseller/';
// 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',
'user' => 'myclient',
'reason' => 'non payment'
];
//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);
?>
unsuspendreseller
Un-suspend Eenos Reseller Account
To un-suspend Eenos reseller hosting account via API.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | eenos reseller account user name | myclient |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /unsuspendreseller/
Default Full URL = https://your-host-name:5555/api/unsuspendreseller/
Version Full URL = https://your-host-name:5555/api/v1/unsuspendreseller/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/unsuspendreseller/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient"
Sample Output
{
"data" : "Reseller account unsuspended myclient",
"info" : "Hosting reseller account unsuspended successfully",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/unsuspendreseller/'
# 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',
'user':'myclient',
}
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='/unsuspendreseller/';
// 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',
'user' => 'myclient',
];
//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);
?>
terminatereseller
Delete Eenos Reseller Account
To remove an Eenos reseller hosting account via API.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | eenos account user name | myclient |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /terminatereseller/
Default Full URL = https://your-host-name:5555/api/terminatereseller/
Version Full URL = https://your-host-name:5555/api/v1/terminatereseller/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/terminatereseller/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient"
Sample Output
{
"data" : "Reseller account terminated myclient",
"info" : "Hosting reseller account terminated successfully",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/terminatereseller/'
# 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',
'user':'myclient',
}
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='/terminatereseller/';
// 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',
'user' => 'myclient',
];
//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);
?>
get_current_users_count
Find the total number of eenos user accounts
To find the total number of eenos hosting accounts.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /get_current_users_count/
Default Full URL = https://your-host-name:5555/api/get_current_users_count/
Version Full URL = https://your-host-name:5555/api/v1/get_current_users_count/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/get_current_users_count/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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"
Sample Output
{
"data" : {
"users" : 31
},
"info" : "Total number of eenos hosting accounts",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/get_current_users_count/'
# 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',
}
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='/get_current_users_count/';
// 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',
];
//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);
?>
get_current_reseller_count
Find the total number of eenos reseller accounts
To find the total number of Eenos reseller hosting accounts.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /get_current_reseller_count/
Default Full URL = https://your-host-name:5555/api/get_current_reseller_count/
Version Full URL = https://your-host-name:5555/api/v1/get_current_reseller_count/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/get_current_reseller_count/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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"
Sample Output
{
"data" : {
"reseller" : 9
},
"info" : "Total number of eenos reseller accounts",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/get_current_reseller_count/'
# 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',
}
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='/get_current_reseller_count/';
// 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',
];
//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);
?>
listsuspended
List Suspended Accounts
To find suspended Eenos hosting accounts.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /listsuspended/
Default Full URL = https://your-host-name:5555/api/listsuspended/
Version Full URL = https://your-host-name:5555/api/v1/listsuspended/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/listsuspended/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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"
Sample Output
{
"data" : {
"accounts" : {
"dreamcatcher" : {
"reason" : "test",
"suspendtime" : "Sun, 07-Feb-2021 10:35:02, America/Los_Angeles",
"user" : "dreamcatcher"
},
"mysite" : {
"reason" : "not paid",
"suspendtime" : "Thu, 11-Nov-2021 11:45:19, America/Los_Angeles",
"user" : "mysite"
}
}
},
"info" : "Suspend hosting accounts",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/listsuspended/'
# 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',
}
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='/listsuspended/';
// 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',
];
//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);
?>
accountsummary
Show Eenos Account Summary
To find the Eenos hosting account details.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
user | eenos account user name | myclient |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /accountsummary/
Default Full URL = https://your-host-name:5555/api/accountsummary/
Version Full URL = https://your-host-name:5555/api/v1/accountsummary/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/accountsummary/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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 "user=myclient"
Sample Output
{
"data" : {
"acct" : {
"addondomains" : "unlimited",
"bandwidth" : "unlimited",
"bandwidth_usage": 8,
"contactemail" : "contact@myclientsite.com",
"dedicatedip" : {
"ipv4" : "1xx.xx.xxx.xxx",
"ipv6" : "2a01:0xxx:0xxx:xxxx:0000:0000:0000:0017",
"status" : "off",
"status6" : "off"
},
"dkim" : "off",
"domain" : "myclientsite.com",
"email" : "unlimited",
"feature" : "Default",
"ftp" : "unlimited",
"homedir" : "/home/myclient",
"is_reseller" : "no",
"is_suspended" : "no",
"language" : "en",
"maillist" : "unlimited",
"mailquota" : "unlimited",
"mailserver" : "local",
"nameservers" : [
"ns1.eenos.com",
"ns2.eenos.com"
],
"owner" : "root",
"package" : "Brownse",
"parkeddomains" : "unlimited",
"quota" : "unlimited",
"quota_usage": 372,
"reseller" : {
"selfown" : "off",
"status" : "off"
},
"setuptime" : "2022-12-13 01:31",
"shell" : {
"shell" : "/sbin/nologin",
"status" : "off"
},
"spf" : "off",
"sql" : "unlimited",
"subdomains" : "unlimited",
"theme" : "default",
"user" : "myclient"
}
},
"info" : "Hosting account summary of user myclient",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/accountsummary/'
# 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',
'user':'myclient',
}
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='/accountsummary/';
// 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',
'user' => 'myclient',
];
//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);
?>
listaccts
List All Eenos Accounts
To list all Eenos hosting accounts via API.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /listaccts/
Default Full URL = https://your-host-name:5555/api/listaccts/
Version Full URL = https://your-host-name:5555/api/v1/listaccts/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/listaccts/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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"
Sample Output
{
"data" : {
"accounts" : {
"a111user" : {
"addondomains" : "unlimited",
"bandwidth" : "1048576",
"contactemail" : "sdsd@sdsds.com",
"dedicatedip" : {
"ipv4" : "x.x.x.x",
"ipv6" : "x:x:x:x:bbbb:0000:0000:x",
"status" : "off",
"status6" : "on"
},
"dkim" : "off",
"domain" : "0000testongfor.com",
"email" : "unlimited",
"feature" : "Xls",
"ftp" : "unlimited",
"homedir" : "/home/a111user",
"is_reseller" : "yes",
"is_suspended" : "no",
"language" : "en",
"maillist" : "unlimited",
"mailquota" : "unlimited",
"mailserver" : "remote",
"nameservers" : [
"dns.a.com",
"ns2.b.com",
"ns3.c.com"
],
"owner" : "root",
"package" : "AoneHost",
"parkeddomains" : "unlimited",
"quota" : "unlimited",
"reseller" : {
"selfown" : "on",
"status" : "on"
},
"setuptime" : "2021-01-24 00:44",
"shell" : {
"shell" : "/bin/bash",
"status" : "on"
},
"spf" : "on",
"sql" : "unlimited",
"subdomains" : "unlimited",
"theme" : "default",
"user" : "a111user"
},
"sysvm" : {
"addondomains" : "0",
"bandwidth" : "1048576",
"contactemail" : "asa@sysvm.com",
"dedicatedip" : {
"ipv4" : "x.x.x.204",
"ipv6" : "x:x:x:2093:bbbb:0000:0000:002a",
"status" : "off",
"status6" : "on"
},
"dkim" : "on",
"domain" : "sysvm.net",
"email" : "0",
"feature" : "Default",
"ftp" : "0",
"homedir" : "/home/sysvm",
"is_reseller" : "yes",
"is_suspended" : "no",
"language" : "en",
"maillist" : "0",
"mailquota" : "0",
"mailserver" : "local",
"nameservers" : [
"ns1.as.com",
"ns2.as.com"
],
"owner" : "sysvm",
"package" : "100Gb",
"parkeddomains" : "0",
"quota" : "102404",
"reseller" : {
"selfown" : "on",
"status" : "on"
},
"setuptime" : "2021-06-27 01:12",
"shell" : {
"shell" : "/bin/bash",
"status" : "on"
},
"spf" : "on",
"sql" : "0",
"subdomains" : "0",
"theme" : "default",
"user" : "sysvm"
}
}
},
"info" : "Return eenos hosting accounts",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/listaccts/'
# 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',
}
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='/listaccts/';
// 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',
];
//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);
?>
listpackages
List All Eenos Hosting packages
To list all eenos hosting packages via API.
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /listpackages/
Default Full URL = https://your-host-name:5555/api/listpackages/
Version Full URL = https://your-host-name:5555/api/v1/listpackages/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/listpackages/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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"
Sample Output
{'data': {'packages': 'Gold,Silver,Platinum,test,Default'},
'info': 'Return eenos hosting packages',
'status': 200}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/listpackages/'
# 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',
}
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='/listpackages/';
// 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',
];
//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);
?>
usagestatistics
Get Eenos Accounts usage metrics
To get all Eenos hosting accounts usage metrics via api. This will return account information, bandwidth usage, and disk usage
Required Parameters
Field | Description | Example |
apiuser | API user name | eenos_api |
apiauth | API user password | eenos123 |
Status Codes
Code | Description |
200 | OK, Success |
500 | Server Error |
403 | Forbidden |
400 | Bad request |
Request URL
Post url = /usagestatistics/
Default Full URL = https://your-host-name:5555/api/usagestatistics/
Version Full URL = https://your-host-name:5555/api/v1/usagestatistics/
Sample Curl Code
#!/bin/bash
REQUEST_URL="/usagestatistics/"
BASE_URL="https://your-host-name:5555/api/v1"
# Default base url
# BASE_URL="https://your-host-name:5555/api"
# Version specific base url
# 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"
Sample Output
{
"data" : {
"accounts" : {
"a111user" : {
"addondomains" : "unlimited",
"bandwidth" : "1048576",
"contactemail" : "sdsd@sdsds.com",
"dedicatedip" : {
"ipv4" : "x.x.x.x",
"ipv6" : "x:x:x:x:bbbb:0000:0000:x",
"status" : "off",
"status6" : "on"
},
"dkim" : "off",
"domain" : "0000testongfor.com",
"email" : "unlimited",
"feature" : "Xls",
"ftp" : "unlimited",
"homedir" : "/home/a111user",
"language" : "en",
"maillist" : "unlimited",
"mailquota" : "unlimited",
"mailserver" : "remote",
"nameservers" : [
"dns.a.com",
"ns2.b.com",
"ns3.c.com"
],
"owner" : "root",
"package" : "AoneHost",
"parkeddomains" : "unlimited",
"quota" : "unlimited",
"reseller" : {
"selfown" : "on",
"status" : "on"
},
"setuptime" : "2023-01-24 00:44",
"shell" : {
"shell" : "/bin/bash",
"status" : "on"
},
"spf" : "on",
"sql" : "unlimited",
"subdomains" : "unlimited",
"theme" : "default",
"user" : "a111user",
"is_reseller" : "yes",
"is_suspended" : "no",
"reseller_data": {
"accounts": [
"lilly123",
"mydreams",
"ntest",
"peace"
],
"contactemail": "sdsd@sdsds.com",
"ips": {
"ipv4": "188.xx.xx.xx",
"ipv6": "2a01:xxxx:xxxx:xxxx:0000:0000:0000:xxxx"
},
"name": "a111user",
"nameservers": [
"ns1.0000testongfor.com",
"ns2.0000testongfor.com",
"ns3.0000testongfor.com",
"ns4.0000testongfor.com"
],
"reseller_bandwidth": "unlimited",
"reseller_limt": "unlimited",
"reseller_quota": "unlimited"
},
"quota_usage_reseller": 1,
"bandwidth_usage_reseller": 0,
"quota_usage": 10234,
"bandwidth_usage": 5545
},
"sysvm" : {
"addondomains" : "0",
"bandwidth" : "1048576",
"contactemail" : "asa@sysvm.com",
"dedicatedip" : {
"ipv4" : "x.x.x.204",
"ipv6" : "x:x:x:2093:bbbb:0000:0000:002a",
"status" : "off",
"status6" : "on"
},
"dkim" : "on",
"domain" : "sysvm.net",
"email" : "0",
"feature" : "Default",
"ftp" : "0",
"homedir" : "/home/sysvm",
"language" : "en",
"maillist" : "0",
"mailquota" : "0",
"mailserver" : "local",
"nameservers" : [
"ns1.as.com",
"ns2.as.com"
],
"owner" : "sysvm",
"package" : "100Gb",
"parkeddomains" : "0",
"quota" : "102404",
"reseller" : {
"selfown" : "off",
"status" : "off"
},
"setuptime" : "2021-06-27 01:12",
"shell" : {
"shell" : "/bin/bash",
"status" : "on"
},
"spf" : "on",
"sql" : "0",
"subdomains" : "0",
"theme" : "default",
"user" : "sysvm",
"is_reseller" : "no",
"is_suspended" : "no",
"quota_usage": 10234,
"bandwidth_usage": 5545
}
}
},
"info" : "Return eenos hosting accounts",
"status" : 200
}
Python Code
#!/usr/bin/python3
import requests
from pprint import pprint
# The API request url
request_url='/usagestatistics/'
# 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',
}
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='/usagestatistics/';
// 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',
];
//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);
?>
EAPI
This is a Command line API to perform operations.
Introduction
About eapi
The eapi is a command line API tool to manage some basic operations on Eenos. This api tool will help to develop Eenos apps.
This API tool have currently some limited functionality, if you like to see some features on this, please let us know.
How to access eapi?
Please use the command line /usr/bin/eapi
Results From EAPI
The EAPI will output results as YAML, JSON, or JsonPretty format. The default output format is YAML. The eapi output contains three parts.
- status: This shows if the API action is successful or not by providing values ok or failed respectively
- message: A generic message with the API actions
- data: A structured data associated with the api actions
All available API commands can be refereed from the coming pages.
login
Authentication or Login Check
To test the login of an Eenos user with the password.
Please provide the password in a base64 encoded format.
It is dangerous to use this command in plain shell which will expose the password of the user. Use this command for testing purposes only and change the user password after testing.
Command:
/usr/local/eenos/scripts/eapi --user=EENOS_USER --login=base64_ENCODED_PASSWORD
Where,
- EENOS_USER is the user name of the eenos accounts
- base64_ENCODED_PASSWORD is the base64 encoded password of the user
Output:
An Example output for Eenso user foo is as follows,
data:
user: foo
message: Login success - foo
status: ok
userinfo
Get the Eenos User Information
This api option will fetch the Eenso user information and show it.
Command:
/usr/local/eenos/scripts/eapi --userinfo --user=USER
Where USER is the Eenos username
Example :
Fetch the user info of Eenos user fun as YAML
# /usr/local/eenos/scripts/eapi --userinfo --user=fun
data:
addondomains: unlimited
bandwidth: unlimited
contactemail: fun@fun.com
dedicatedip:
ipv4: 10.40.192.204
ipv6: 2a01:4f8:120:20xx::xx
status: 'off'
status6: 'off'
dkim: 'on'
domain: fun.com
email: unlimited
feature: Default
ftp: unlimited
homedir: /home/fun
language: en
maillist: unlimited
mailquota: unlimited
mailserver: local
nameservers:
- ns1.domain.com
- ns2.domain.com
- ns3.domain.com
owner: root
package: Gold
parkeddomains: unlimited
quota: unlimited
reseller:
selfown: 'off'
status: 'off'
setuptime: 2021-01-23 23:14
shell:
shell: /usr/sbin/nologin
status: 'off'
spf: 'on'
sql: unlimited
subdomains: unlimited
theme: default
user: fun
message: user information of - fun
status: ok
Fetch the user info of Eenos user fun as JSON Pretty
# /usr/local/eenos/scripts/eapi --userinfo --user=fun --output=jsonpretty
{
"status": "ok",
"message": "user information of - fun",
"data": {
"addondomains": "unlimited",
"bandwidth": "unlimited",
"contactemail": "fun@fun.com",
"dedicatedip": {
"ipv4": "10.40.192.204",
"ipv6": "2a01:4f8:120:20xx::xx",
"status": "off",
"status6": "off"
},
"dkim": "on",
"domain": "fun.com",
"email": "unlimited",
"feature": "Default",
"ftp": "unlimited",
"homedir": "/home/fun",
"language": "en",
"maillist": "unlimited",
"mailquota": "unlimited",
"mailserver": "local",
"nameservers": [
"ns1.domain.com",
"ns2.domain.com",
"ns3.domain.com"
],
"owner": "root",
"package": "Gold",
"parkeddomains": "unlimited",
"quota": "unlimited",
"reseller": {
"selfown": "off",
"status": "off"
},
"setuptime": "2021-01-23 23:14",
"shell": {
"shell": "/usr/sbin/nologin",
"status": "off"
},
"spf": "on",
"sql": "unlimited",
"subdomains": "unlimited",
"theme": "default",
"user": "fun"
}