Skip to main content

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:

    Authentication Headers Request Payload (Data) API Endpoint URL

    1. Authentication Headers

    TheEvery APIrequest URLmust has include the following sections,

      Header Data Part Post URL part

      Header

      The header contains the API authentication headers as follwos,headers:

      • X-API-USER  :  The API userusername nameused for authentication.
      • X-API-PASSWORD : The API password
      associated

      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

      the

      Each API request.operation Eenosis hasexposed through a uniquededicated endpoint.

      API
      Base urlFormats
      for every operation. 

      There are two types ofsupported API URLs.URL The default url and version-based url.formats:

      Example,

      • Default URL:API URLhttps://your-host-name:5555/api/

      Example,

      Versioned VersionAPI url:URL (recommended): https://your-host-name:5555/api/v1/

      The versioned format ensures backward compatibility and stability across releases.

      Every

      Default vs Versioned API

      request needs the
      Default API URL
      to
      performUses the requestedserver’s task.default API version (currently v1). May change in future releases without notice.
      DefaultVersioned API URL

      This

      APIExplicitly 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 ontargets a specific  API version of(e.g., thev1).

      eenosRecommended controlfor panel.production Atintegrations thisto time,ensure westability. have version

       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 info status
        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.

        Some
        other200 indicates success Other codes willindicate beerrors providedor inspecific theconditions coming(documented apiper documentAPI) with every 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

          X-API-USERUSER: =eenos_api

          X-API-PASSWORDPASSWORD: =eenos123

          Endpoint Example

            URL: = https://dev.eenos.com:your-host-name::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: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 provided

              This 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:

              apiuser
              nameIncorrect andAPI apiauth,username or yourpassword IP hasaddress restrictions for accessingon the API usingaccount Disabled or unauthorized API user

              Solution:

              Verify credentials and confirm that the givenrequesting apiIP loginis credentials.allowed for API access.

              Demo servers don't have API access.