Introduction
What is WAP API ?
This API is used to manage eenos accounts and reseller. You may use this documentation to integrate 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 favourite programming language or curl command.
Main Components of API URL
The API URL have two parts ,
- Data Part
- Post URL part
Data Part
Data part containcontains the data send to the API url . Every data part need to have some parameters that is 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 need apiuser and apiauth parameters to perform the operationoperation.
Post URL
TheThis API UrlURL that is performingperforms the operation of the API request. Eenos have unique API url for every operations. There are two typetypes of API URLs . The defaaultdefault url and version based userurl.
Exampe , Default URL : https://your-host-name:5555/api/
Example , Version url : https://your-host-name:5555/api/v1/
Every API Request needneeds the API URL to perform the requested tasktask.
Default URL
This API url useuses the default api version provided by the server. At this timetime, the default url is version 11.
Version URL
If you like to perform operations on a specific API version of the eenos control panel . At this timetime, we have version 1 urlurl,
Response & Output
The result from the API requests will be in Json data format.format which will have three partsparts.
- info
- status
data
The data json dictionary will contain the data preformed after api operationoperation.
info
This field provideprovides an information about the APIAPI.
status
This field provideprovides the operation status code. If the status code is 200, then the operation is successsuccess. , thereThere are some other codecodes tooalso that will be provided in the coming api document with every operation.
Example
The following example showsshows, how to send an API request to Eenos WAP Admin ,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 srever Load Average .
Authentication Errors
The API requests will show two type of authentication errors errors.
- Authentication credentials were not provided
- You do not have permission to perform this action.
Authentication credentials were not provided
As the message showingshowing, you need to send apiuser and apiauth to perform the operationoperation.
You do not have permission to perform this action.
You may be used the wrong apiuser name and apiauth.apiauth, Oror your IP have restrictionrestrictions for accessing the API using the given api login credentials.