Others

This section covers methods not covered by the other sections.

Documentation

getConfig

Get spreadsheet config.

GET /api/:guid

thumbnail

A small picture of the document for lists and previews. The clients draw it and the adapter stores it next to the document (thumbnail), outside the spreadsheet: nothing is broadcast and the history is untouched. Anyone who can load the document can refresh it, and the document list returns it.

Parameter Description
data Base64 data URL of a webp, png or jpeg image, up to 64 KB.

GET /api/:guid/thumbnail returns { "thumbnail": "data:image/webp;base64,..." }, or null when there is none

POST /api/:guid/thumbnail

DELETE /api/:guid/thumbnail

delete

Delete spreadsheet.

DELETE /api/:guid

Examples

Get config

const baseUrl = 'http://localhost:8009/api';
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
const token = 'eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i';
const headers = { 'Authorization': `Bearer ${token}` };

// Get the spreadsheet config
const config = await (await fetch(`${baseUrl}/${guid}`, { headers })).json();

console.log(config);

Delete spreadsheet

const baseUrl = 'http://localhost:8009/api';
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
const token = 'eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i';
const headers = { 'Authorization': `Bearer ${token}` };

// Delete the spreadsheet document
await fetch(`${baseUrl}/${guid}`, {
    method: 'DELETE',
    headers,
});