Deck

Decks of Cards are the foundation to any game and through our API they are accessed at /api/deck.

Identities

We have many types of standard decks which you can access through one of these identities:

BridgeDeck
BusinessDeck
ClearCardCraftingDeck
CardCraftingDeck
CircleDeck
DividerDeck
DominoDeck
EuroPokerDeck
EuroSquareDeck
FoilPokerDeck
FoilTarotDeck
HexDeck
JumboDeck
MicroDeck
MiniDeck
MintTinDeck
PokerDeck
SmallSquareDeck
SquareDeck
TarotDeck
USGameDeck

Properties

Each deck has the following properties. Complete details in DeckProperties.

id

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

identity

The style of deck you want. See Identities above.

wing_object_type

pokerdeck

date_created

A date when the deck was created.

date_updated

A date when the deck was last updated.

name

The name the deck is known by.

game_id

A Game id. The unique id of a game that this deck belongs to.

quantity

An integer between 1 and 99. Defaults to 1. Allows for multiple copies of a deck to be included in the game.

back_id

A File id. Sets the back image of the card. The ID is from a File. If a back_id is specified, then an extra property called back will be added which will briefly describe the image. If the two sided set has no back, and a member is assigned a back, then that back will also be assigned to the set.

has_proofed_back

A boolean indicating whether the back image has been verified by the user to be correct.

card_count

The number of cards in the deck.

Relationships

cards

The list of Cards that are attached to this deck.

Related Objects

game

The Game that this deck is a member of.

Methods

The methods used to fetch and manipulate decks.

Create

 POST /api/deck
session_id

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

name

Required.

game_id

Required.

quantity

Optional.

back_id

Optional.

has_proofed_back

Optional.

Returns:

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

Update

 PUT /api/deck/xxx

See Create for details.

Delete

 DELETE /api/deck/xxx
session_id

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

Returns:

 {
   "success" : 1
 }

Fetch

 GET /api/deck/xxx
session_id

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

_include_relationships

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

Returns:

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

Bulk Create Cards

Normally you'd use the "Create" in Card to attach cards to a deck, but there is a special utility endpoint to create up to 100 cards in a single API call.

 POST /api/deck/xxx/bulk-cards
cards

A JSON array, with each element of the array being a JSON object containing all the parameters you'd use in "Create" in Card to create a card. At most can create 100 cards in one call.

  [
    {
      "name" : "card 16", 
      "face_id" : "6936C64A-63EA-11EB-83C6-F9DE983DDA9C"
    },
    {
      "name" : "card 17", 
      "face_id" : "69544350-63EA-11EB-83C6-F9DE983DDA9C"
    },
    {
      "name" : "card 18", 
      "face_id" : "this will fail"
    }
  ]

Returns:

  {
    "result" : {
        "cards" : [
          {
              "date_created" : "2021-01-31 17:35:34",
              "can_edit" : 1,
              "back_from" : "Deck",
              "object_type" : "card",
              "has_proofed_back" : 0,
              "has_proofed_face" : 0,
              "face_id" : "6936C64A-63EA-11EB-83C6-F9DE983DDA9C",
              "can_view" : 1,
              "quantity" : 1,
              "object_name" : "Card",
              "face_size" : "825x1125",
              "id" : "B9106FC2-63EA-11EB-83C6-F9DE983DDA9C",
              "back_id" : null,
              "class_number" : 1,
              "deck_id" : "01D110E2-63E9-11EB-9E85-C916AE721651",
              "date_updated" : "2021-01-31 17:35:34",
              "back_size" : "825x1125",
              "name" : "card 16"
          },
          {
              "date_created" : "2021-01-31 17:35:34",
              "can_edit" : 1,
              "back_from" : "Deck",
              "object_type" : "card",
              "has_proofed_face" : 0,
              "has_proofed_back" : 0,
              "can_view" : 1,
              "face_id" : "69544350-63EA-11EB-83C6-F9DE983DDA9C",
              "quantity" : 1,
              "face_size" : "825x1125",
              "object_name" : "Card",
              "id" : "B9689D6E-63EA-11EB-83C6-F9DE983DDA9C",
              "deck_id" : "01D110E2-63E9-11EB-9E85-C916AE721651",
              "class_number" : 1,
              "back_id" : null,
              "date_updated" : "2021-01-31 17:35:34",
              "name" : "card 17",
              "back_size" : "825x1125"
          },
          { 
            "error" : {
              "code" : 440,
              "message" : "face_id 'this will fail' not found."
            },
          }
        ],
        "errors" : 1
    }
  }

The errors element lets you know how many errors (if any) happened while processing the cards. And any errors that happened will be in the position in the cards array of the card the failed.

^ Back to Top ^