Developer Page

Use this web page to learn how you can access the 3D print content on this website for your own app or website. Learn how to programmatically access user profiles, shops and shop items (3D models).

Learn how to make a single-page-app that we will host for you on this website and how your app will be surfaced alongside 3D content and how you can get programmatic access to which 3D model a user was visiting when they clicked to open it in your web app.

We welcome any developer that wants to use these APIs to make an app, website or other thingamabob. Please send any feedback or questions to info@3dprintmakers.com.

What Does the API Do?

The API is available as a HTTP Hypermedia API service that you call using standard HTTP clients. Each API resource (user profile, shop an shop item) has a unique URL. For example, each user profile has a unique URL you can HTTP GET. You can page through user profiles and programmatically get links to shops they have created. Read more about the terminology and details of Hypermedia API below. Scroll down a little further for code samples.

API Terminology

Below is a table of terminology and definitions.

Term Definition
User Profile Publically accessible representation of a user. Each user has a user profile with their user name and any other public information they want to share. The user profile also has links to what the user has created, like shops.
Shop A publically accessible collection of shop items that is owned by a user. Shops have a title, short description and collection of items.
Shop Item A unique listing in a shop that has a title, description, downloadable content, license, free or price and stats.
Shop Item Stats Statistics about a shop item like cumulative number of views and downloads.

Hypermedia API Structure

This API is built using a Hypermedia API structure that follows the hal+json standard. This basically means that we have each resource addressable by a URL, we respect the HTTP methods, the response content is formatted in JSON and the response will contain links with rels (like a UI would) so your code can know what the next available options are to navigate to. For example, a user profile HTTP response will contain properties and values about the user profile in addition to links to shops the user created. If you HTTP GET the user profile's shop links then you will get an HTTP response that contains properties and values about the shop in addition to links to each shop item.

Our Hypermedia API has an entry point, just like a web site has a front page. The entry point has links you can programmatically follow to get started. See the code sample below.

Code Samples

HTTP GET Entry Point

HTTP GET http://www.3dprintmakers.com/api Headers Content-Type: application/hal+json Accept: application/hal+json Response { "_links": { "getShops": { "href": "/api/shops?userId={userId:int}" }, "getUserProfiles": { "href": "/api/user-profiles" }, "getNewestShopItems": { "href": "/api/shop/all/item/all" }, "self": { "href": "http://www.3dprintmakers.com/api" } }, "_embedded": { } }

Single Page Web Apps

A single-page-app is HMTL+JavaScript in a single page that is hosted right here on www.3dprintmakers.com. You don't have to setup and manage a web server. Just write the code that will make your app great.

You can write these kinds of apps directly in the www.3dprintmakers.com platform and have them shown in different parts of the website for people to open the content in your app. For example, you can write an app that accepts a shopItem query string parameter and www.3dprintmakers.com will display the app in a list on each shop item's page under the Open in Web App button. Let's say your app shows a WebGL rendering of a 3D model when the file is .STL. www.3dprintmakers.com will pass the shopItem query string value and open your app in a new browser tab. Then your HTML+JavaScript might have a <script> tag to include the three.js JavaScript library and jQuery JavaScript library. Upon receiving the shopItem query string value, you can use a jQuery ajax call to make a standard HTTP GET call to the www.3dprintmakers.com API to get a link to the shop item's get3dPreview link to download a .STL preview version of the item. Then use the three.js library to convert the .STL binary file to WebGL and display it in the web browser. Then code some rotate and zooming controls.

Sample App

This recommender app titled Find Other 3D Objects Like This is a sample app we created to demonstrate using the www.3dprintmakers.com recommendation API with the single-page-app feature. It is an app that is shown on a shop item page when you click the Open in Web App button. This app will look at the shopItem query string parameter and pass it in to the recommendation API and display the 3 recommendations that come back with a title and thumbnail picture.

App Ideas

Web apps should be family-friendly and we reserve the right to remove any app that is too violent, uses abusive language or is for pornographic purposes. In general, we encourage apps that are useful, fun and delightful. They should help the user accomplish some goal, like viewing a file in 3D, sending a file to a service to be printed or sending the item to a group of friends on a social network.

Browse Apps

The Browse Apps page has a list of all available apps.

Questions

If you have any programming questions or want some sample code to get started then please email us at info@3dprintmakers.com with App Question in the subject line.

You can login to www.3dprintmakers.com, go the Dashboard and click the Create App link under the Developer section.

Future Updates

Right now only public information is available, meaning you can not programmatically get data as a logged in user. We plan on adding support for logging in using OAuth and getting user-specific data in the future.