Skip to main content

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,

  1. Data Part
  2. 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.

  1. data
  2. info
  3. 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.

  1. Authentication credentials were not provided
  2. 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.