API Documentation
Drafft comes with an optional REST API for querying on a loaded project. It is an App Setting and can be enabled in options.
For now, this will only work if Drafft is running and a project is loaded.
APP Options
Enable API: If true a REST API will be started when opening a project.API Key: This API key will need to be present in the request header asx-api-keyAPI Port: The port where the server will listen to connections. Default 9001
API Reference
Get Info, and Project settings
Currently Drafft API only works if a project is loaded. This endpoint will return the project settings.and Some metadata about the user and app.
GET /info
Get Game Export
Gets a game-ready JSON object. Same as clicking "Export Game Content" in the app.
GET /game-export
The exported collections will be as defined in the project settings althought they can be specified for further filtering with a collections field with comma separated values:
Accepted Collection Values:
ProjectSettings- Project configuration and settingsGDD- Game Design DocumentsScripts- Script documents with dialogue lines and commandsDialogues- Dialogue tree structures with nodes and connectionsActors- Character definitions with properties and expressionsQuests- Quest structures with properties and conditionsItems- Item definitions and propertiesVariables- State definitions with default values (JSON format)Scenarios- Variable state snapshots (JSON format)Scenes- Sequential playlists of Scripts and DialoguesMisc- Miscellaneous custom data structuresGrids- Spreadsheet dataKanban- Kanban board cards and columns
Example Queries:
# Export specific collections
GET /game-export?collections=Scripts,Items,Actors
# Export full game state including variables and scenarios
GET /game-export?collections=Scripts,Dialogues,Variables,Scenarios,Scenes
# Export all data structures
GET /game-export?collections=ProjectSettings,GDD,Scripts,Dialogues,Actors,Quests,Items,Variables,Scenarios,Scenes,Misc,Grids,Kanban
Get Database Dump
Gets a database dump directly from the PouchDB instance. It accepts any PouchDB allDocs options.
Default options are include_docs: true and options.attachments: true
GET /db-dump
GET /db-dump
GET /db-dump?include_docs=false&attachments=false&descending=true