Document Properties

Each document has the following properties and is accessed via /api/document. Complete details in DocumentProperties.

id

The unique id for this document. It will never change.

wing_object_type

document

date_created

A date when the document was created.

date_updated

A date when the document was last updated.

name

The name the document is known by.

game_id

A Game id. The unique id of a game that this document belongs to.

quantity

An integer between 1 and 99. Defaults to 1. Allows for multiple copies of a document to be included in the game.

pdf_id

A File id. Sets the PDF that will be used to print the document. The ID is from a File. If a pdf_id is specified, then an extra property called pdf will be added which will briefly describe the image.

use_for

Defaults to Print and Download. Tells the document whether it should be downloadable, printable, or both.

Related Objects

game

The Game that this document is a member of.

Document Options

use_for

The list of available options for the use_for field.

Document Methods

The methods used to fetch and manipulate documents.

Create Document

 POST /api/document
session_id

Required. The unique session id provided by a Session method.

name

Required.

game_id

Required.

quantity

Optional.

pdf_id

Optional.

use_for

Optional.

Returns:

 {
   "id" : "xxx",
   "name" : "Rules",
   ...
 }

Update Document

 PUT /api/document/xxx

See Create Document for details.

Delete Document

 DELETE /api/document/xxx
session_id

Required. The unique session id provided by a Session method.

Returns:

 {
   "success" : 1
 }

Fetch Document

 GET /api/document/xxx
session_id

Optional. The unique session id provided by a Session method.

_include_relationships

Optional. See "Relationships" in Intro and Document Relationships above for details.

Returns:

 {
   "id" : "xxx",
   "name" : "Rules",
   ...
 }
^ Back to Top ^