Skip to content

EneaSys/whmcs_api_rest_ful_client_java

Repository files navigation

whmcs-api-restfull-client

Requirements

Building the API client library requires Maven to be installed.

Installation

To install the API client library to your local Maven repository, simply execute:

mvn install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn deploy

Refer to the official documentation for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
    <groupId>com.clodesk.lib</groupId>
    <artifactId>whmcs-api-restfull-client</artifactId>
    <version>0.0.1</version>
    <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "com.clodesk.lib:whmcs-api-restfull-client:0.0.1"

Others

At first generate the JAR by executing:

mvn package

Then manually install the following JARs:

  • target/whmcs-api-restfull-client-0.0.1.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import com.clodesk.lib.whmcs_api_restfull_client.invoker.*;
import com.clodesk.lib.whmcs_api_restfull_client.invoker.auth.*;
import com.clodesk.lib.whmcs_api_restfull_client.model.*;
import com.clodesk.lib.whmcs_api_restfull_client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    public static void main(String[] args) {
        
        DefaultApi apiInstance = new DefaultApi();
        RequestAcceptOrder apiParameters = new RequestAcceptOrder(); // RequestAcceptOrder | 
        try {
            WhmcsResponseSuccessAcceptOrder result = apiInstance.acceptOrder(apiParameters);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#acceptOrder");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://www.sm-host.com/modules/addons/rest_ful

Class Method HTTP request Description
DefaultApi acceptOrder POST /AcceptOrder Accepts a pending order
DefaultApi addOrder POST /AddOrder Add order
DefaultApi updateClientProduct POST /UpdateClientProduct Update client Product

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization. Authentication schemes defined for the API:

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author