node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org »

boxc

BoxC

An Unofficial NodeJS Library for BoxC API

Compatibility: Node.js version 5+

Install with npm:

npm install boxc

Official Documentation HERE

API

Create access token

Generates authorization URL

const BoxC = require('boxc');
 
// Get authorization url 
var authorizationURL = BoxC.getAuthorizationURL(APPLICATION_ID, returnURI);
 
//... after user got authorized, you get nonce 
 
BoxC.createAccessToken(APPLICATION_ID, APPLICATION_SECRET, nonce)
  .then(accessToken => new BoxC(accessToken));
 
// if last argument will be true, you don't need invoke "new BoxC(accessToken)" 
 
BoxC.createAccessToken(APPLICATION_ID, APPLICATION_SECRET, nonce, true)
  .then(api => {
    // work with boxc api 
  });
    
// or create using (/static?) constructor 
(new BoxC(token)) instanceof BoxC
BoxC.create(token) instanceof BoxC

Entry Points

Estimate

Invoices

Labels

Manifests

Overpacks

Shipments

Users

Examples

estimate

api.estimate({
  country: 'US', // not required, now - default & only US 
  postal_code: '94041', // destination postal code 
  entry_point: 'HKCN', // https://api.boxc.com/site/entry-points 
  height: 10, // cm 
  width: 10, // cm 
  length: 10, // cm 
  weight: 0.9 // kg 
}).then(estimate => console.log(estimate));