BoxC
An Unofficial NodeJS Library for BoxC API
Compatibility: Node.js version 5+
Install with npm
:
npm install boxc
API
Create access token
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
- getOverpacks(args)
- getOverpack(id)
- createOverpack(overpack)
- updateOverpack(id, overpack)
- deleteOverpack(id, overpack)
Shipments
- getShipments(args)
- getShipment(id)
- createShipment(shipment)
- updateShipment(id, shipment)
- deleteShipment(id)
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));