Skip to content

whiteboard

Marcel Kloubert edited this page Aug 11, 2017 · 13 revisions

Home >> Whiteboard

Whiteboard

A "whiteboard" is a virtual document that can be used to store information about the current project, e.g.

{
    "rest.api": {
        // ...

        "whiteboard": {
            "dir": "./myWhiteBoardRevisionFiles"
        }
    }
}
Name Description
dir The directory where all revision files should be stored. If not defined, all revisions will be stored in memory and will be lost, when the editor is closed.
isActive Indicates if "whiteboard" feature is active or not. Default: (true)

Endpoints

DELETE /api/whiteboard

Deletes the whiteboard and all its revisions.

canDelete property must be set to (true) for an user or guest in the settings to access the endpoint.

Example

DELETE /api/whiteboard

Possible response:

Connection: keep-alive
Date: 2017 Feb 19 18:04:18
Transfer-Encoding: chunked
X-Vscode-Restapi: 1.16.0

{
    "code": 0
}

Other responses

Code Description
403 User has no right to delete the whiteboard.
404 Whiteboard is not available.

GET /api/whiteboard(/revision)

Gets the current (or a specific) revision of the whiteboard.

Get current

GET /api/whiteboard

Possible response:

Connection: keep-alive
Content-Type: text/markdown; charset=utf-8
Date: 2017 Feb 19 18:04:18
Transfer-Encoding: chunked
X-Vscode-Restapi: 1.16.0
X-Vscode-Restapi-Revision: 0
X-Vscode-Restapi-Title: My whiteboard

# My project

This is a sample whiteboard document written in Markdown

Get specific revision

GET /api/whiteboard/3

Possible response:

Connection: keep-alive
Content-Type: text/markdown; charset=utf-8
Date: 2017 Feb 19 18:04:18
Transfer-Encoding: chunked
X-Vscode-Restapi: 1.16.0
X-Vscode-Restapi-Revision: 3
X-Vscode-Restapi-Title: My whiteboard

# My project

This is a sample whiteboard document written in Markdown, Version 4

Other responses

Code Description
404 Whiteboard is not available or there is currently no (matching) document available.

POST /api/whiteboard

Resets the whiteboard with a new document.

canDelete and canWrite properties must be set to (true) for an user or guest in the settings to access the endpoint.

Example

POST /api/whiteboard

{
    "content": "IyBNeSBwcm9qZWN0XG5cblRoaXMgaXMgYSBzYW1wbGUgd2hpdGVib2FyZCBkb2N1bWVudCB3cml0dGVuIGluIE1hcmtkb3du",
    "encoding": "utf8",
    "mime": "text/markdown",
    "title": "My whiteboard"
}

Instead of using a NewWhiteboardRevision object, which stores the content in Base64 format, you can submit a JSON parsed string that is handled as text/plain utf-8 encoded document.

Possible response:

Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/json; charset=utf-8
Date: 2017 Feb 19 18:20:33
Transfer-Encoding: chunked
X-Vscode-Restapi: 1.16.0
X-Vscode-Restapi-Revision: 0
X-Vscode-Restapi-Title: My whiteboard

{
    "code": 0,
    "data": {
        "path": "/api/whiteboard/0",
        "revision": 0,
        "title": "My whiteboard",
        "mime": "text/markdown",
        "encoding": "utf-8",
        "length": 72
    }
}

Other responses

Code Description
403 User has no right to reset the whiteboard with new content.
404 Whiteboard is not available.

PUT /api/whiteboard

Adds a new revision of a document to the whiteboard.

canWrite property must be set to (true) for an user or guest in the settings to access the endpoint.

Example

PUT /api/whiteboard

{
    "content": "IyBNeSBwcm9qZWN0XG5cblRoaXMgaXMgYSBzYW1wbGUgd2hpdGVib2FyZCBkb2N1bWVudCB3cml0dGVuIGluIE1hcmtkb3du",
    "encoding": "utf8",
    "mime": "text/markdown",
    "title": "My whiteboard"
}

Instead of using a NewWhiteboardRevision object, which stores the content in Base64 format, you can submit a JSON parsed string that is handled as text/plain utf-8 encoded document.

Possible response:

Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/json; charset=utf-8
Date: 2017 Feb 19 18:20:33
Transfer-Encoding: chunked
X-Vscode-Restapi: 1.16.0
X-Vscode-Restapi-Revision: 0
X-Vscode-Restapi-Title: My whiteboard

{
    "code": 0,
    "data": {
        "path": "/api/whiteboard/7",
        "revision": 7,
        "title": "My whiteboard",
        "mime": "text/markdown",
        "encoding": "utf-8",
        "length": 72
    }
}

Other responses

Code Description
403 User has no right to add a new revision to the whiteboard.
404 Whiteboard is not available.
Clone this wiki locally