Jump to content

A Node.js based WHMCS API Client


Recommended Posts

WHMCS-API

WHMCS API is a client platform made in nodejs for WHMCS

Initializing

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 :-)
    }
whmcs.initialize(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(new 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(new Error(error)))

 

PS: I'm not at all experienced in whmcs, but i tried to make something ;) 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated