0.1.1 • Published 3 years ago

ggizmo-api v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

node-gizmo-api

Gizmo API Library for Node.js (NOT OFFICIAL)

GCGApp Build Status

Installation

Read Gizmo API Documentation - link

npm install ggizmo-api

Quick Example

const api = require('ggizmo-api')

async () => {
    try {
        // Make sure you have the correct port open and the web portal enabled in the settings.
        // Enable Bearer | Basic token use True | False
        const con = new api(true, {
            host: "localhost",
            port: 80,
            ssl: false,
            username: 'admin',
            password: 'admin'
        });
        
        //Generate new Token
        await con.createToken()
        
        //Using APIv2
        const v2 = con.v2()
        
        //Simple Fetch query
        const test = await v2.UserGroups.Get()
        const data = await test.json()
        
        console.log(data)
    } catch (err) {
        // ... http error checks
    }
}

Commands

All commands are identical to the requests that are specified in your server documentation (http: //localhost/doc/index.html) Example:

APIv2 => UserGroups => GET QUERY = v2().UserGroups.Get(Options)

Here we use the GET request of the Usergroup

Available Commands

  • AppCategories
  • AppDeployments
  • AppEnterprises
  • AppExecutables
  • AppGroups
  • AppLicenses
  • AppPersonalFiles
  • Apps
  • AppTasks
  • Assets
  • AssetTransactions
  • AssetTypes
  • Attributes
  • BillingProfiles
  • DepositTransactions
  • HostGroups
  • HostIcons
  • Hosts
  • InvoicePayments
  • Invoices
  • MonetaryUnits
  • Operators
  • PaymentMethods
  • ProductGroups
  • Products
  • ProductsStock
  • Registers
  • RegisterTransactions
  • Reservations
  • SalePresets
  • StockTransactions
  • Taxes
  • UserGroups
  • Users
  • Variables

Token

You can use Basic authorization or Bearer

const init = new api(true, { username:'admin',password:'admin' })
await init.createToken()
//Authorization: Bearer Generated Token

const init = new api(false, { username:'admin',password:'admin' })
//Authorization: Basic base64(username:password)

Also, if you already have a Token, you can specify it during initialization.

const init = new api(true, { token: '{TOKEN}' })

License

GGizmo-API is released under the MIT License

0.1.1

3 years ago

0.1.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago