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 the curl command.
Main Components of API URL
The API URL has the following sections,
- Header
- Data Part
- Post URL part
Header
The header contains the API authentication headers as follwos,
- X-API-USER : The API user name
- X-API-PASSWORD: The API password
Data Part
The data part contains the data sent to the API URL. This data will be used for the API operations.
Every API Request needs X-API-USER and X-API-PASSWORD 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 JSON dictionary will contain the data returned 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,
X-API-USER=eenos_api
X-API-PASSWORD=eenos123
URL = https://dev.eenos.com:5555/api/load-average/
Sample CURL Command on Default API Url
curl -X POST \
-H "X-API-USER: eenos_api" \
-H "X-API-PASSWORD: eenos123" \
https://dev.eenos.com:5555/api/load-average/
Sample CURl Command on Version API URl, v1
curl -X POST \
-H "X-API-USER: eenos_api" \
-H "X-API-PASSWORD: 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.