Propose a change to a game's rules
const url = 'https://api.thebgdb.org/v1/games/5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77/rules/proposals';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"edition":"5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77:original","language":"en","sections":{"setup":"- Build the island from the hexes.\n- Each player places two settlements."},"base":{"setup":null}}'};
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/games/5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77/rules/proposals \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "edition": "5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77:original", "language": "en", "sections": { "setup": "- Build the island from the hexes.\n- Each player places two settlements." }, "base": { "setup": null } }'A confirmed member sends new text for one or more sections of one edition’s rules in one language. A moderator accepts all of it or some sections, or rejects it. base is the text you saw for each section, so a moderator can tell when someone changed it meanwhile. An empty string empties a section. Each section holds 6,000 characters. A member can send 20 a day.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The game’s id, as returned in every game object. The game’s slug is accepted too.
Example
5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77Request Bodyrequired
Section titled “Request Bodyrequired”object
A language code such as “en”, “fr” or “pt-BR”.
Plain text with light formatting: paragraphs separated by a blank line, lines starting with - or 1. for lists, **bold**. Never HTML.
object
object
Example
{ "edition": "5c9b0f43-7a39-4f0c-8a4e-2f2d2b1d9a77:original", "language": "en", "sections": { "setup": "- Build the island from the hexes.\n- Each player places two settlements." }, "base": { "setup": null }}Responses
Section titled “Responses”Sent. It waits for a moderator (pending); a moderator’s own change is written at once (accepted).
object
object
Example
{ "data": { "id": "3f0c5d2e-1b4a-4c3d-9e8f-7a6b5c4d3e2f", "status": "pending" }}The sections, the language or the edition are not accepted, or nothing changed.
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 request has no valid session token.
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 game has this id, or it has no such edition.
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"}Too many requests, or too many of these sent today (code says which).
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"}