Shapeways API

The Shapeways model upload interface has the following specifications:
  • SOAP over HTTP
  • Publicly available on www.shapeways.com

Functionalities

The Shapeways API enables you to:
Download the available material definitions, including their properties.
Upload a model

Also see the Add To Cart API

Methods

login

The login call enables users to authenticate themselves to Shapeways. The model upload call requires the resulting session id.
public function login($username, $password, $application_id = null)
Type Name Description Length Obligatory
String username Username of the user. Username is the username a user uses to login on the portal. 50 Y
String password Password of the user. The password is the password that is used to login on the portal 100 Y
String application_id ID depending on the application used, is free to choose. 100 N
Returns
String session_id ID for the login session when login is successful 32

getPrinters

The getPrinters call is used to retrieve the available materials that Shapeways offers. The materials are grouped per printer.
public function getPrinters($session_id, $templateId = null, $application_id=null)
Type Name Description Length Obligatory
String session_id The sessionid returned when calling login 32 N
String application_id Unique ID of the application using the interface. Free to choose by developers. 100 N
Returns
PrinterArray printerArray Array with printers with their materials.

submitModel

This is the call where the model will be uploaded. This uses the session id returned from the Login call.
public function submitModel($session_id, SWModel $model, $templateId = null, $application_id)
Type Name Description Length Obligatory
String session_id The sessionid returned when calling login 32 N
String application_id Unique ID of the application using the interface. Free to choose by developers. 100 N
SWModel model The model to upload (including the file) n/a Y
Integer templateId If we have a template we can have different calculations 11 N
Returns
String State Will answer successful or failed about upload

Data types


PrinterArray

PrinterArray
Title Type Length Unit
title String 50
volume Float 20.4 cm3
wallthickness Float 20.4 cm
technology String 255
x_bound_min Float 20.4 cm
x_bound_max Float 20.4 cm
y_bound_min Float 20.4 cm
y_bound_max Float 20.4 cm
z_bound_min Float 20.4 cm
z_bound_max Float 20.4 cm
materials MaterialArray n/a

MaterialArray

MaterialArray
Title Type Length
id Integer 11
title String 50
description String 1024
base_color String 255 color definition for display / preview purposes
specular_color String 255
shininess Integer 10
opacity Float 20.4
translucency Float 20.4
refractive_index Float 20.4

SWModel

SWModel
Title Type Length/Values Remark
title String 50 characters
desc String 1024 characters
modeltype String VRML, STL, X3D, X3DB, X3DV, DAE, ZIP Obligatory. For some templates, x3d is obligatary.
view_state Integer 0 - view only
1 - for sale
2 - hidden
Defaults to 1 (for sale).
Note: hidden means that the model is publicly available via direct link but is not findable through either site search or any gallery.
file Base64Binary Obligatory, the model itself.
file_uri String 255 characters
filename String 100 characters
tags String Comma-delimited string Descriptive tags for the model
has_color Binary 0 or 1 0 = no color, 1 = color
scale Float 20.4 Scale compared to meters (0.001 for mm 0.01 for cm 0.0254 for inch).
Obligatory for stl files as that format has no unit in the format. Ignored for other files.
markup Float 20.4 Markup in dollars. Use this field to immediately set the markup for this model on upload.


Location

The services are located at
http://www.shapeways.com/modules/shapeways_api/webservice/v1/soap.php

The WSDL for the web services can be found at http://api.shapeways.com/v1/wsdl.php

Process example

An example in what order the methods can be used to upload a model
  • To be able to display a list of materials the getPrinters can be called. This will return an array of printers, each printer can contain an array of one or more materials.
  • Before a model can be submitted the user needs to login into Shapeways. For this the call login is to be used. Login expects the same username and password that the user uses to login into the portal. This call will return a session id that is needed to use with the submit model call.
  • When user determines the model is ready for upload, the model can be submitted by using the 'submitModel' call. For this a session_id is need which can be obtained by the 'login' call.
To directly upload a model, login and submitModel is sufficient.

Application identifier

Use the name of your application here. The id can be chosen freely but should be less than 100 characters.

Terms and conditions

To make sure a user accepts to the terms and conditions of Shapeways. A model that is uploaded using the interface is set to private by default. Before the user can use the model on the Shapeways portal, one must agree to the terms and conditions.

Download API specifications


Download the doc as PDF

Download PHP implementation

We made a PHP reference implementation for you to download. Please use it as you see fit.

demoshapewayssoapapi_v1_0.tar

Who's using the Shapeways API?

The following applications are using the Shapeways API: