Back to top

FiveRingsDB

An API to access cards and decks data from https://api.fiveringsdb.com

Cards

Resources related to cards.

Card Collection

List All Cards
GET/cards

Anonymous access.

Whenever possible, use this action and put the data into cache if you need card data. Send the If-Modified-Since request header, and use the Cache-Control and Last-Modified response headers.

Example URI

GET https://api.fiveringsdb.com/cards
Response  200
HideShow
Headers
Content-Type: application/json

Card

View a Card Detail
GET/cards/{code}

Anonymous access.

Get the data of one card. Don’t use this action unless you really can’t use the previous action.

Example URI

GET https://api.fiveringsdb.com/cards/code
URI Parameters
HideShow
code
string (required) 

ID of the Card in the form of a string slug (“a-card-code”)

Response  200
HideShow
Headers
Content-Type: application/json

Card Rulings

Resources related to cards rulings. Write access is protected by the ROLE_RULINGS permission.

Card Rulings

View all Rulings
GET/rulings

Anonymous access.

Text is Markdown.

Example URI

GET https://api.fiveringsdb.com/rulings
Response  200
HideShow
Headers
Content-Type: application/json

Card Ruling Collection

Create a Ruling
POST/cards/{card_id}/rulings

Requires ROLE_RULINGS.

Text may be Markdown, but is not parsed.

Example URI

POST https://api.fiveringsdb.com/cards/card_id/rulings
URI Parameters
HideShow
card_id
string (required) 

ID of the Card in the form of a string slug (“example-card-code”)

Response  200
HideShow
Headers
Content-Type: application/json

List Rulings By Card
GET/cards/{card_id}/rulings

Anonymous access.

Text may be raw Markdown.

Example URI

GET https://api.fiveringsdb.com/cards/card_id/rulings
URI Parameters
HideShow
card_id
string (required) 

ID of the Card in the form of a string slug (“example-card-code”)

Response  200
HideShow
Headers
Content-Type: application/json

Card Ruling

Edit a Ruling
PATCH/cards/{card_id}/rulings/{id}

Requires ROLE_GURU, and user must be the ruling’s creator.

Text may be Markdown, but is not parsed.

Example URI

PATCH https://api.fiveringsdb.com/cards/card_id/rulings/id
URI Parameters
HideShow
card_id
string (required) 

ID of the Card in the form of a string slug (“example-card-code”)

id
integer (required) 

ID of the Ruling in the form of an integer

Response  200
HideShow
Headers
Content-Type: application/json

View a Ruling Detail
GET/cards/{card_id}/rulings/{id}

Anonymous access.

Text is Markdown.

Example URI

GET https://api.fiveringsdb.com/cards/card_id/rulings/id
URI Parameters
HideShow
card_id
string (required) 

ID of the Card in the form of a string slug (“example-card-code”)

id
integer (required) 

ID of the Ruling in the form of an integer

Response  200
HideShow
Headers
Content-Type: application/json

Card Reviews

Resources related to cards reviews. Write access is protected by the ROLE_REVIEWS permission.

Card Review Collection

Create a Review
POST/cards/{card_id}/reviews

Requires ROLE_REVIEWS.

Text may be Markdown, but is not parsed.

Example URI

POST https://api.fiveringsdb.com/cards/card_id/reviews
URI Parameters
HideShow
card_id
string (required) 

ID of the Card in the form of a string slug (“example-card-code”)

Response  200
HideShow
Headers
Content-Type: application/json

List Reviews By Card
GET/cards/{card_id}/reviews

Anonymous access.

Text may be raw Markdown.

Example URI

GET https://api.fiveringsdb.com/cards/card_id/reviews
URI Parameters
HideShow
card_id
string (required) 

ID of the Card in the form of a string slug (“example-card-code”)

Response  200
HideShow
Headers
Content-Type: application/json

Card Review

Edit a Review
PATCH/cards/{card_id}/reviews/{id}

Requires ROLE_REVIEWS, and user must be the review’s creator.

Text may be Markdown, but is not parsed.

Example URI

PATCH https://api.fiveringsdb.com/cards/card_id/reviews/id
URI Parameters
HideShow
card_id
string (required) 

ID of the Card in the form of a string slug (“example-card-code”)

id
integer (required) 

ID of the Review in the form of an integer

Response  200
HideShow
Headers
Content-Type: application/json

View a Review Detail
GET/cards/{card_id}/reviews/{id}

Anonymous access.

Text may be raw Markdown.

Example URI

GET https://api.fiveringsdb.com/cards/card_id/reviews/id
URI Parameters
HideShow
card_id
string (required) 

ID of the Card in the form of a string slug (“example-card-code”)

id
integer (required) 

ID of the Review in the form of an integer

Response  200
HideShow
Headers
Content-Type: application/json

Deck Validation

Deck Validation

  • Attributes DeckContent
    • card-id (string)
      • copies (integer)

Validate a deck
POST/deck-validation/{format}

The request must be a JSON representation of a deck cards. Open the Request section below to see an example.

The response is a JSON object. The value of the status key is the result of the validation. The following table describes the possible values of status:

status description
0 Deck is valid
1 Deck has too many copies of one or more cards
2 Deck has too few Strongholds
3 Deck has too many Strongholds
4 Deck has too many Roles
5 Deck has too few Dynasty cards
6 Deck has too many Dynasty cards
7 Deck has off-clan Dynasty cards
8 Deck has too few Conflict cards
9 Deck has too many Conflict cards
10 Deck does not have enough influence for its off-clan Conflict cards
11 Deck has more than one off-clan in its Conflict deck
12 Deck has too many Character cards in its Conflict deck
13 Deck has too few Provinces
14 Deck has too many Provinces
15 Deck has too many Provinces of one Element
16 Deck has an off-clan Province
17 Deck has an off-clan Conflict card with no influence cost

Example URI

POST https://api.fiveringsdb.com/deck-validation/format
URI Parameters
HideShow
format
string (required) 

Format of the deck to validate (possible values: standard, single-core)

Request
HideShow
Body
{
  "shizuka-toshi": 1,
  "ancestral-lands": 1,
  "elemental-fury": 1,
  "the-art-of-peace": 1,
  "night-raid": 1,
  "pilgrimage": 1
}
Response  200
HideShow
Headers
Content-Type: application/json

Deck Strains

A Deck Strain is a series of Decks that are different versions of the same deck.

To create a Deck, one must first create a Deck Strain. Then a Deck can be added to the Strain.

The first Deck of a Strain is version 0.1. The second is version 0.2, etc.

The last Deck in a Strain is called the Head of the Strain.

Strain Collection

  • Attribute Deck

    • id (string)
    • name (string)
    • description (string)
    • format (string)
    • cards: (DeckContent)
    • created_at: (datetime)
    • user_id: (string)
    • nb_likes: (integer)
    • version: (string)
    • problem: (integer)
    • strain: (string)
  • Attribute Strain

    • id (string)
    • head (Deck)

Create a Strain
POST/strains

If the User has not reached her quota, a Strain is created and returned.

If origin was passed in the JSON body and a Deck can be found with this ID and that Deck can be read by the User, then a Deck is created in the Strain as a copy of that Deck.

Example URI

POST https://api.fiveringsdb.com/strains
Request
HideShow
Body
{
  "origin": "Hello, world!"
}
Schema
{
  "type": "object",
  "properties": {
    "origin": {
      "type": "string",
      "description": "Optional ID of the Deck which will be copied to create the first Deck in the Strain"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json

List all Strains
GET/strains

Example URI

GET https://api.fiveringsdb.com/strains
Response  200
HideShow
Headers
Content-Type: application/json

Strain

Delete a Strain
DELETE/strains/{id}

Delete a Strain and all its Decks.

Example URI

DELETE https://api.fiveringsdb.com/strains/id
URI Parameters
HideShow
id
uuid (required) 

ID of the Strain

Response  200
HideShow
Headers
Content-Type: application/json

Get a Strain
GET/strains/{id}

Get a Strain and its head (public).

Example URI

GET https://api.fiveringsdb.com/strains/id
URI Parameters
HideShow
id
uuid (required) 

ID of the Strain

Response  200
HideShow
Headers
Content-Type: application/json

Strain Deck

Strain Deck Collection

List all Decks of a Strain
GET/strains/decks

Example URI

GET https://api.fiveringsdb.com/strains/decks
Response  200
HideShow
Headers
Content-Type: application/json

Create a Strain Deck
POST/strains/decks

Excepts a Deck as request body.

Example URI

POST https://api.fiveringsdb.com/strains/decks
Response  200
HideShow
Headers
Content-Type: application/json

Strain Deck

Get details about a Deck
GET/strains/decks/

Example URI

GET https://api.fiveringsdb.com/strains/decks/
Response  200
HideShow
Headers
Content-Type: application/json

Delete a Strain Deck
DELETE/strains/decks/

Example URI

DELETE https://api.fiveringsdb.com/strains/decks/
Response  200
HideShow
Headers
Content-Type: application/json

Generated by aglio on 01 Dec 2017