1.0.5 • Published 6 years ago

shapeways-alva v1.0.5

Weekly downloads
10
License
MIT
Repository
github
Last release
6 years ago

Node Shapeways 2018 (shapeways-alva)

CodeFactor license npm node

Custom node.js module for accessing the Shapeways api using oAuth 2. By Project alva. Shapewayslogo

Installation

NPM

npm install shapeways-alva

Documentation

API CALLS

  • authorize(params,callback)
  • getModels(callback)
  • getMaterials(callback)
  • getCategories(callback)
  • getPrinters(callback)
  • getCart(callback)
  • getModelInfo(modelId, callback)
  • addToCart(params, callback)
  • addModel(params, callback)
  • deleteModel(modelId, callback)
  • updateModelInfo(modelId, params, callback)
  • getModelFile(modelId, fileVersion, callback)
  • addModelPhoto(modelId, params, callback)

Checkout API (REQUIRES PERMISSION TO USE)

  • getOrders(callback)
  • getOrderInfo(orderId, callback)
  • createOrder(parmas, callback)

HTTP Request Handling

  • getReq(url, callback)
  • postReq(url, params, callback)
  • putReq(url, params, callback)
  • deleteReq(url, callback)

Example

(See /testing folder in github-repo for more examples)

Import module

const shapeways = require('shapeways-alva');

Performing a 'GET' request

shapeways.getModels(function(err,resp){
  if(err){
    console.log(err);
  }
  console.log(resp);
});

Performing a 'POST' request

var params = {
  modelId: 1234567,
  materialId: 4, //4: Transparent Acrylic
  quantity: 1
};

shapeways.addToCart(params, function(err,resp){
  if(err){
    console.log(err);
  }
  console.log(resp);
});

NOTE: resp and err is a JSON objects, tip: JSON.stringify().

License

The MIT License (MIT) Copyright (c) 2014 Brett Langdon <brett@blangdon.com>

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.
1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago