WHMCS Node API Module
This module only supports authenticating with API credentials. No one should be implementing API logins with username passwords at this point, its depreciated as of 7.2!
Please report any bugs using the issue tracker.
Positive feedback helps fuel development. This module is very simple yet effective for my business needs. PR requests are welcome!
npm install node-whmcs
First you need to instantiate it.
const WHMCS = ;const whmcsClient =host: 'yourwebsite.com' //dont include http/https.identifier: 'api identifier'secret: 'api secret'//endpoint: 'includes/api.php', //only required if you changed the api.php location;
Using the created client, call the methods you need, example:
//get 10 clients. seewhmcsClient;//update a client. seewhmcsClient;//delete the first client. seewhmcsClient;//get domain details. seewhmcsClient;
- call(action, options):
- get(action, options): An alias of "call" but appends "Get" to the name.
- add(action, options): An alias of "call" but appends "Add" to the name.
- update(action, options): An alias of "call" but appends "Update" to the name.
- delete(action, options): An alias of "call" but appends "Delete" to the name.
The "action" (string) is the name of a WHMCS API Index name. The "options" (object) of any parameters you want to pass in.
The MIT License (MIT)
Copyright (c) 2019 Drew Gauderman
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.