whmcs-api

1.5.5 • Public • Published

WHMCS-API

WHMCS API is a client platform made in nodejs for WHMCS

Installation

npm i whmcs-api --save

Initializing

const Client = require("whmcs-api")
 
let init = {
        // Specifying API.php Endpoint
        "endpoint": "path/to/includes/api.php",
        // Authentication
        "identifier":"",
        "secret":"",
        // OR
        "username": "",
        "password": "",
        // Other Required Parameters.
        "accesskey":"",
        "responsetype":"json" // Change this to break the module :-)
    }
const whmcs = new Client(init)

Calling API

This WHMCS API client uses promise based calling. This is an example.

whmcs.call(API_Index, Parameters)
    .then(data => console.log(data))
    .catch(error => console.error(error))

Parameters should contain the API Index's Request Parameter.

Example:

GetInvoice You don't have to specify action parameter. This is how we're gonna specify invoiceid parameter:

whmcs.call("GetInvoice", {
    invoiceid: 1
}).then(data => console.log(data))
  .catch(error => console.error(error))
 
  // OR
 
whmcs.call("GetTickets")
  .then(data => console.log(data))
  .catch(error => console.error(error))

Readme

Keywords

Package Sidebar

Install

npm i whmcs-api

Weekly Downloads

13

Version

1.5.5

License

ISC

Unpacked Size

3.81 kB

Total Files

3

Last publish

Collaborators

  • at0mic.xyz