Export the draft as Markdown or plain text
Code Mode: praxis.studio.works.drafts.retrieveExport
HTTP: GET /studio/v1/works/{work}/drafts/{draft}/export
Read the whole draft as one document in Markdown or plain text, returned synchronously in the answer. This is the quick path for a person who wants the text now; a file in a platform format, a card image or a docx comes from creating a rendition instead. Ask for text rather than markdown when the reader should not see block anchors or heading syntax.
Signature
praxis.studio.works.drafts.retrieveExport(args:{path:{/** e.g. "wu-gang" */ work:string;/** e.g. "novel" */ draft:string};query:{/** e.g. "markdown" */ format:"markdown"|"text"}}):Promise<{/** The draft text: Markdown with headings, list markers and block anchors, or plain text with the markup removed. e.g. "第十二章 排字房\\n\\n排字房的铅字盘上,压着一张通缉令。" */ content:string;/** Content revision of the draft this text was produced from, so a caller can tell whether it exported the latest text. e.g. 96 */ revision:number}>;Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| work | path | string | yes | The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value. |
| draft | path | string | yes | Draft being addressed, either its in-work key such as novel or its drf_ identifier; a key renamed earlier still resolves through its previous value. |
| format | query | “markdown” | “text” | yes | Format to render the draft in: markdown keeps headings, list markers and block anchors, and text drops the markup entirely. |
Responses
| Status | Content types | Description |
|---|---|---|
| 200 | application/json | The controller text together with the draft revision it was produced from. |
| 400 | application/json | INVALID_PARAMS means a field is missing, malformed or not allowed for this resource; correct the named field and repeat the call. |
| 401 | application/json | The API key is missing, invalid or carries no organization; send a valid organization key in the Authorization header. |
| 404 | application/json | WORK_NOT_FOUND or DRAFT_NOT_FOUND means the work or the draft inside it is not reachable; use the slug and the draft key from the lists, or resolve a loose name first. A draft renamed earlier still answers under its previous key. |
| 500 | application/json | INTERNAL means the request could not complete; re-read the resource before retrying a write, because the write may already have landed. |