Introduction
What is WAP API?
ThisThe WAP API is a REST-based interface used to manage eenosEenos accountsaccounts, resellers, and resellers.system Youoperations. mayIt useallows thisseamless documentationintegration to integrateof the Eenos hosting control panel into yourwith billing systemsystems, automation tools, or otherany remote management services. service.
The eenos API is a REST framework to manage requests. You can sendinteract with the requestsAPI using your favoriteany programming language or thestandard curltools command.such as curl.
API Architecture Overview
MainA ComponentsWAP API request is composed of three main parts:
1. Authentication Headers
TheEvery APIrequest URLmust has include the following sections,
Header
The header contains the API authentication headers as follwos,headers:
- X-API-USER :
The APIuserusernamenameused for authentication. - X-API-PASSWORD : The API password
Data Part
The data part contains the data sent towith the API URL.user.
This
These datacredentials willare be usedrequired for theall API operations.
Every API Request needs X-API-USER and X-API-PASSWORD parameters to operate.
Post2. URLRequest Data
This data is used by the API to process the request and execute the desired action.
3. API URL operatesStructure
Each API request.operation Eenosis hasexposed through a uniquededicated endpoint.
Base urlFormats
There are two types ofsupported API URLs.URL The default url and version-based url.formats:
Example,
- Default
URL:API URL: https://your-host-name:5555/api/
Example,
The versioned format ensures backward compatibility and stability across releases.
Every
Default vs Versioned API
Default API URL
DefaultVersioned API URL
This
Version URL
This is to perform operations ontargets a specific API version of(e.g., thev1).
1 url.
Response & Output
TheAll resultAPI fromresponses are returned in JSON format with the following API requests will be in Json data format, which will have three parts.structure:
data
The JSON dictionary will containContains the dataresult returnedof afterthe apiAPI operation.
info
ThisProvides fielda provideshuman-readable informationdescription aboutof the API.response.
status
This field provides the operation status code. If theHTTP-like status code is 200, thenindicating the operationresult isof athe success.operation.
Example
The following example shows,shows how to send an API request to Eenos WAP Admin.
We are using the following data,
Credentials Used
Endpoint Example
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:your-host-name:5555/api/load-average/
Sample CURlCURL Command on Version API URl, v1
curl -X POST \
-H "X-API-USER: eenos_api" \
-H "X-API-PASSWORD: eenos123" \
https://dev.eenos.com:your-host-name:5555/api/v1/load-average/
Output
{
"data": {
"load_average": "0.55 0.51 0.46"
},
"info": "Current server load",
"status":200} 200
}
The above APIThis request will retrieveretrieves the serverserver’s Loadcurrent Average.load average.
Authentication Errors
The API requestsmay willreturn showthe twofollowing typesauthentication-related of authentication errors.errors:
1.
Authentication credentials were not providedThis error occurs when the required authentication headers are missing.
Solution:
Ensure that both X-API-USER and X-API-PASSWORD headers are included in the request.
2. You do not have permission to perform this action.
Authentication credentials were not provided
action
AsThis the message shows, you need to send apiuser and apiauth to operate.
You do not have permission to perform this action.
Youerror may useoccur thedue wrongto:
Solution:
Verify credentials and confirm that the givenrequesting apiIP loginis credentials.allowed for API access.
Demo servers don't have API access.