Part Properties

Each part has the following properties and is accessed via /api/part. Complete details in PartProperties.

id

The unique id for this part. It will never change.

wing_object_type

part.

date_created

A date when the part was created.

date_updated

A date when the part was last updated.

name

The name the part is known by.

quantity

An integer between 1 and 2147483647. Defaults to 1. This is how many of the part are in stock.

photo_id

Sets an image of the part. The ID is from a File. If a photo_id is specified, then an extra property called photo will be added which will briefly describe the image.

description

A full written description of the part.

price

The retail price of this part.

price_10

The same as price, but represents the price for each when purchased in quantities of 10 or greater.

price_100

The same as price_10, but represents the price for each when purchased in quantities of 100 or greater.

price_1000

The same as price_100, but represents the price for each when purchased in quantities of 1000 or greater.

original_price

The same as price, but ignores sales.

original_price_10

The same as original_price, but represents the price for each when purchased in quantities of 10 or greater.

original_price_100

The same as original_price_10, but represents the price for each when purchased in quantities of 100 or greater.

original_price_1000

The same as original_price_100, but represents the price for each when purchased in quantities of 1000 or greater.

sku_id

The stock keeping unit to be used when adding this to the Cart.

weight

The weight of this part in pounds.

color

The color of the part. Defaults to Pictured. See Part Options below for details.

category

Basic taxonomy for the part. Defaults to Miscellaneous. See Part Options below for details.

Part Relationships

gameparts

The list of GamePart that use this part.

similar

Returns a list of similar parts. See "Similar Parts" below.

Part Methods

The methods used to fetch and manipulate parts.

Part Options

Provides a list of the options that can be used to fill out various fields when creating or updating a part.

 GET /api/part/_options

Returns:

 {
    "color" : [...],
    "category" : [...]
 }

NOTE: You can also get this data by adding _include_options=1 to the parameter list when fetching a part.

Create Part

 POST /api/part
session_id

Required. The unique session id provided by a Session method.

name

Required.

photo_id

Optional.

weight

Optional.

quantity

Optional.

low_quantity

Optional.

color

Optional.

category

Optional.

notes

Optional.

description

Optional.

Returns:

 {
   "id" : "xxx",
   "name" : "Joystick Pawn",
   ...
 }

Update Part

 PUT /api/part/xxx

See Create Part for details.

Delete Part

 DELETE /api/part/xxx
session_id

Required. The unique session id provided by a Session method.

Returns:

 {
   "success" : 1
 }

Fetch Part

 GET /api/part/xxx
session_id

Optional. The unique session id provided by a Session method.

_include_options

Optional. See "Options" in Intro and Part Options above for details.

_include_relationships

Optional. See "Relationships" in Intro and Part Relationships above for details.

Returns:

 {
   "id" : "xxx",
   "name" : "Rope",
   ...
 }

Search All Parts

We use a search engine called Algolia https://www.algolia.com for our event data. This allows you to perform fast and complex searches that aren't possible with our Rest API.

To access the Algolia search engine you'll need 3 bits of information:

First you'll need to know the index name, which is parts.

Second, our application ID is 5V0BUFDX8J.

Third, our public key is a25692c12853aea7a77c5a7125498512.

Algolia's API documentation can be found here: https://www.algolia.com/doc/.

And they have a really sweet UI builder that can be found here: https://community.algolia.com/instantsearch.js/.

© 2011-2017 The Game Crafter, LLC