Library Game

Games contained in a Library. Library Games are accessed via /api/librarygame.

Properties

See "Object Properties" in Introduction for basic shared properties.

Complete details in LibraryGameProperties.

Related Objects

See "Related Objects" in Introduction for how to use them.

lastcheckout

The LibraryGameCheckout most recently created for this game.

library

The Library this game belongs to.

Relationships

See "Relationships" in Introduction for how to use them.

checkouts

The LibraryGameCheckouts created for this game.

inventoryitems

The LibraryInventoryItems created for this game.

playtowins

The PlayToWins associated with this library game.

Services

The services used to fetch and manipulate library games.

Search Library Games

This section describes basic searchability of Library Games, which is now available across different endpoints.

Available Endpoints

To request events, a user must make a request via an endpoint for a parent object. The parent objects for which this consolidated search behavior is valid are:

Library
LibraryInventory

Departures/differences from basic behavior will be discussed in the documentation for the specific parent=>event relationship. (The old endpoint GET /api/librarygame, which allowed searching across libraries, has been made admin-only.)

Returns:

 {
    "paging" : {...},
    "items" : [
        {
          "id" : "xxx",
          "name" : "The Captain Is Dead",
          ...
        },
        ...
    ]
 }
Optional Params
Queryables

Pass a string query to search for a partial match in specifically allowed text fields.

Queryable fields
catalog_number

(can be searched only by specifying field with query_field=catalog_number; see options below)

description

(can be searched only by specifying field with query_field=description; see options below)

name

name is automatically searched if you pass a string value in the query parameter. It is the only automatically searched field.

publisher_name

(can be searched only by specifying field with query_field=publisher_name; see options below)

Queryable options
query_single_term

For Library Games, query now supports multiple match terms at once. To do this, merely separate your search terms with commas. So where the term "The Captain Is Dead" will return any Library Game matching all of "The Captain Is Dead", the term "Captain,Dead" will return all Library Games with names matching either Captain or Dead. (Any whitespace around the commas is automatically removed; "Captain, Dead" and "Captain ,Dead" are equivalent to "Captain,Dead".)

To prevent a query parameter with a comma in it from being split into multiple terms, include query_single_term=1.

query_field

Use of query will search only in the text field name by default. Alternate fields to query are catalog_number, description, and publisher_name. Simply set query_field to the field you want to search in.

Qualifiers
age
availability

availability is a way of getting different result sets with one setting. There are four valid values for availability:

available

Same as is_checked_out=0 and is_in_circulation=1.

checked_out

Same as is_checked_out=1. Deprecated version of this setting is checkedout.

not_in_circ OR not_in_circulation

Same as is_in_circulation=0. Deprecated version of this setting is notincirc.

triage

Same as due_for_triage=1.

bgg_id
bgg_version_id
catalog_number
checkout_count
due_for_triage
is_checked_out
is_in_circulation
is_play_to_win
max_play_time
max_players
min_play_time
min_players
preferred_players

Same as passing min_players=<=x&max_players=>=x, where x is the number of preferred players.

preferred_time

Same as passing min_play_time=<=x&max_play_time=>=x, where x is the preferred time in minutes.

Create Library Game

 POST /api/librarygame
Required Params
library_id
name
catalog_number

Returns the same as a normal read.

Read Library Game

 GET /api/librarygame/xxx

Returns:

 {
   "id" : "xxx",
   "name" : "The Captain is Dead",
   ...
 }

Update Library Game

 PUT /api/librarygame/xxx

Returns the same as a normal read.

Delete LibraryGame

 DELETE /api/librarygame/xxx

Returns:

 {
   "success" : 1
 }

Add Comment to Library Game

 POST /api/librarygame/xxx/add-comment

Adds a comment to the Library Game log. User session must be active.

Returns:

 {
   "success" : 1
 }