-
Notifications
You must be signed in to change notification settings - Fork 4
/
documentation.apib
290 lines (176 loc) · 6.68 KB
/
documentation.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
FORMAT: 1A
HOST: https://api.fiveringsdb.com
# FiveRingsDB
An API to access cards and decks data from https://api.fiveringsdb.com
# Group Cards
Resources related to cards.
## Card Collection [/cards]
### List All Cards [GET]
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.
+ Response 200 (application/json)
## Card [/cards/{code}]
+ Parameters
+ code (string) - ID of the Card in the form of a string slug ("a-card-code")
### View a Card Detail [GET]
Anonymous access.
Get the data of one card. Don't use this action unless you really can't use the previous action.
+ Response 200 (application/json)
# Group Card Rulings
Resources related to cards rulings. Write access is protected by the ROLE_RULINGS permission.
## Card Rulings [/rulings]
### View all Rulings [GET]
Anonymous access.
Text is Markdown.
+ Response 200 (application/json)
## Card Ruling Collection [/cards/{card_id}/rulings]
+ Parameters
+ card_id (string) - ID of the Card in the form of a string slug ("example-card-code")
### Create a Ruling [POST]
Requires ROLE_RULINGS.
Text may be Markdown, but is not parsed.
+ Response 200 (application/json)
### List Rulings By Card [GET]
Anonymous access.
Text may be raw Markdown.
+ Response 200 (application/json)
## Card Ruling [/cards/{card_id}/rulings/{id}]
+ Parameters
+ card_id (string) - ID of the Card in the form of a string slug ("example-card-code")
+ id (integer) - ID of the Ruling in the form of an integer
### Edit a Ruling [PATCH]
Requires ROLE_GURU, and user must be the ruling's creator.
Text may be Markdown, but is not parsed.
+ Response 200 (application/json)
### View a Ruling Detail [GET]
Anonymous access.
Text is Markdown.
+ Response 200 (application/json)
# Group Card Reviews
Resources related to cards reviews. Write access is protected by the ROLE_REVIEWS permission.
## Card Review Collection [/cards/{card_id}/reviews]
+ Parameters
+ card_id (string) - ID of the Card in the form of a string slug ("example-card-code")
### Create a Review [POST]
Requires ROLE_REVIEWS.
Text may be Markdown, but is not parsed.
+ Response 200 (application/json)
### List Reviews By Card [GET]
Anonymous access.
Text may be raw Markdown.
+ Response 200 (application/json)
## Card Review [/cards/{card_id}/reviews/{id}]
+ Parameters
+ card_id (string) - ID of the Card in the form of a string slug ("example-card-code")
+ id (integer) - ID of the Review in the form of an integer
### Edit a Review [PATCH]
Requires ROLE_REVIEWS, and user must be the review's creator.
Text may be Markdown, but is not parsed.
+ Response 200 (application/json)
### View a Review Detail [GET]
Anonymous access.
Text may be raw Markdown.
+ Response 200 (application/json)
# Group Deck Validation
## Deck Validation [/deck-validation/{format}]
+ Attributes DeckContent
- *card-id* (string)
- copies (integer)
+ Parameters
+ format (string) - Format of the deck to validate (possible values: `standard`, `single-core`)
### Validate a deck [POST]
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 |
+ Request
+ Body
```json
{
"shizuka-toshi": 1,
"ancestral-lands": 1,
"elemental-fury": 1,
"the-art-of-peace": 1,
"night-raid": 1,
"pilgrimage": 1
}
```
+ Response 200 (application/json)
# Group 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 [/strains]
+ 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]
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.
+ Request
+ Attributes
+ origin (string) - Optional ID of the Deck which will be copied to create the first Deck in the Strain
+ Body
```json
{
"origin": "8979b558-8193-11e7-84b2-685b35b003e2"
}
```
+ Response 200 (application/json)
### List all Strains [GET]
+ Response 200 (application/json)
## Strain [/strains/{id}]
+ Parameters
+ id (uuid) - ID of the Strain
### Delete a Strain [DELETE]
Delete a Strain and all its Decks.
+ Response 200 (application/json)
### Get a Strain [GET]
Get a Strain and its head (public).
+ Response 200 (application/json)
# Group Strain Deck
## Strain Deck Collection [/strains/{id}/decks]
### List all Decks of a Strain [GET]
+ Response 200 (application/json)
### Create a Strain Deck [POST]
Excepts a Deck as request body.
+ Response 200 (application/json)
## Strain Deck [/strains/{id}/decks/{id}]
### Get details about a Deck [GET]
+ Response 200 (application/json)
### Delete a Strain Deck [DELETE]
+ Response 200 (application/json)