Finish a large rulebook once its parts are sent
const url = 'https://api.thebgdb.org/v1/rulebook-uploads/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/complete';const options = {method: 'POST', headers: {'x-upload-token': '<x-upload-token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.thebgdb.org/v1/rulebook-uploads/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/complete \ --header 'x-upload-token: <x-upload-token>'Puts the parts together. The file becomes a rulebook that waits for review, exactly as one sent with POST /games/{id}/rulebooks, under the same id as the upload. Its pages is null at first: the pages are counted from the stored file within the hour, usually within seconds.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The upload’s id, from POST /games/{id}/rulebooks/uploads.
Responses
Section titled “Responses”The rulebook was stored and waits for review.
object
object
What the file is. rulebook: the game’s rules (the only type structured rules are drafted from); player_aid: player aids, reference sheets, rules summaries; score_sheet: score sheets and printable trackers; faq: FAQ and errata; campaign: campaign logs, scenario books; print_and_play: print-and-play files; variant: solo, automa and fan variants; other: anything else.
A language code such as “en”, “fr” or “pt-BR”.
Which edition or printing the rules belong to, when the uploader said.
One PDF file, or one image per page.
Number of pages. Null for a PDF whose pages could not be counted.
Bytes, all files together.
The files, in reading order. A PDF has one.
object
Path of the file on this API.
Bytes.
What the file shows: rulebook for a page sent as an image; null for a PDF, which is not an image. box_front the whole front of the box; box_back its back; box_partial the box at an angle, cropped, or an overall shot of it; board_traditional the board of a traditional game that never had a box (chess, go); setup the game laid out ready to play; in_play a game in progress, nobody visible; components the pieces, boards and tokens; cards cards; people people playing, or any person, face or hand in the picture; rulebook a page of the rules; logo a title or logo alone; other anything else. New words may be added; treat an unknown one as other.
Example
{ "data": { "id": "c2b7e5a4-3f1d-4b7c-8f0a-9e6d5c4b3a21", "type": "rulebook", "language": "en", "edition": "5th edition, 2015", "kind": "pdf", "pages": null, "size": 4812330, "files": [ { "path": "/v1/media/rulebooks/5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77/c2b7e5a4-3f1d-4b7c-8f0a-9e6d5c4b3a21/1.pdf", "contentType": "application/pdf", "size": 4812330, "kind": null } ], "status": "pending" }}The parts do not add up to the size announced. The upload is discarded.
object
What went wrong, in plain English words. The wording may change: act on code.
A stable name for this refusal, for programs and for showing the message in another language. A code is never renamed; new ones may be added.
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
Example
{ "error": "Game not found", "code": "game_not_found"}The x-upload-token header is missing, or the token has expired.
object
What went wrong, in plain English words. The wording may change: act on code.
A stable name for this refusal, for programs and for showing the message in another language. A code is never renamed; new ones may be added.
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
Example
{ "error": "Game not found", "code": "game_not_found"}The member has not confirmed their email address.
object
What went wrong, in plain English words. The wording may change: act on code.
A stable name for this refusal, for programs and for showing the message in another language. A code is never renamed; new ones may be added.
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
Example
{ "error": "Game not found", "code": "game_not_found"}No upload has this id and token: it was completed, cancelled or discarded, or the token is another upload’s.
object
What went wrong, in plain English words. The wording may change: act on code.
A stable name for this refusal, for programs and for showing the message in another language. A code is never renamed; new ones may be added.
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
Example
{ "error": "Game not found", "code": "game_not_found"}Some parts have not arrived (missing lists their numbers), or the parts could not be put together.
object
Example
{ "error": "Some parts have not arrived yet. Send them first.", "missing": [ 4, 7 ]}Over a request limit. rate_limited: without a token, 60 a minute and 2,000 a UTC day per address (more with a token; see Limits above). weekly_limit: the week’s requests or game details are used up (params.max is the cap). The retry-after header says how many seconds to wait: 60 for a minute’s limit, until midnight UTC for a day’s, until Monday 00:00 UTC for a week’s.
object
What went wrong, in plain English words. The wording may change: act on code.
A stable name for this refusal, for programs and for showing the message in another language. A code is never renamed; new ones may be added.
The numbers the sentence names, when it names any: for example { "max": 20 } with daily_photo_limit.
object
Example
{ "error": "Game not found", "code": "game_not_found"}