Decks of Cards are the foundation to any game and through our API they are accessed at /api/deck
.
We have many types of standard decks which you can access through one of these identities:
Each deck has the following properties. Complete details in DeckProperties.
The unique id for this deck. It will never change.
The style of deck you want. See Identities above.
pokerdeck
A date when the deck was created.
A date when the deck was last updated.
The name the deck is known by.
A Game id. The unique id of a game that this deck belongs to.
An integer between 1 and 99.
Defaults to 1
.
Allows for multiple copies of a deck to be included in the game.
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.
A boolean indicating whether the back image has been verified by the user to be correct.
The number of cards in the deck.
The methods used to fetch and manipulate decks.
POST /api/deck
Required. The unique session id provided by a Session method.
Required.
Required.
Optional.
Optional.
Optional.
Returns:
{ "id" : "xxx", "name" : "Tools", ... }
PUT /api/deck/xxx
See Create for details.
DELETE /api/deck/xxx
Required. The unique session id provided by a Session method.
Returns:
{ "success" : 1 }
GET /api/deck/xxx
Optional. The unique session id provided by a Session method.
Optional. See "Relationships" in Intro and Deck Relationships above for details.
Returns:
{ "id" : "xxx", "name" : "Tools", ... }
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
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.