Spreadsheet cells

Read and write cell data and values.

Documentation

getData

Get the worksheet data.

GET /api/:guid/:worksheetIndex/data

setData

Replace the worksheet data.

Parameter Description
{array} New data.

POST /api/:guid/:worksheetIndex/data

Cell values

Update a cell value

const baseUrl = 'https://your-server.example.com/api';
const token = 'MSxlMjE2MWI5YWNjYTg2MzM4MThmN2Y4NjY0YmQzYzBlOGExMmVkZjVk';
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
const headers = { 'Authorization': `Bearer ${token}` };

// Set a new value on cell C4 (x: 2, y: 3) of worksheet 0
await fetch(`${baseUrl}/${guid}/0/value`, {
    method: 'POST',
    headers,
    body: new URLSearchParams({
        'data[0][x]': '2',
        'data[0][y]': '3',
        'data[0][value]': 'New value',
    }),
});

Retrieve cell values

Request a single cell, a list of cells or a range.

Get values from cells

const baseUrl = 'https://your-server.example.com/api';
const token = 'MSxlMjE2MWI5YWNjYTg2MzM4MThmN2Y4NjY0YmQzYzBlOGExMmVkZjVk';
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
const headers = { 'Authorization': `Bearer ${token}` };

// Get the values from cells C4, D4 and D5 of worksheet 0
const values = await (await fetch(`${baseUrl}/${guid}/0/value/C4,D4,D5`, { headers })).json();
console.log(values);

// [
//     {
//         x: 2,
//         y: 3,
//         name: "C4",
//         value: "C4",
//     },
//     {
//         x: 3,
//         y: 3,
//         name: "D4",
//         value: null,
//     },
//     {
//         x: 3,
//         y: 4,
//         name: "D5",
//         value: null,
//     },
// ]

Get values from a range

const baseUrl = 'https://your-server.example.com/api';
const token = 'MSxlMjE2MWI5YWNjYTg2MzM4MThmN2Y4NjY0YmQzYzBlOGExMmVkZjVk';
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
const headers = { 'Authorization': `Bearer ${token}` };

// Get the values from the range C1:C2 of worksheet 0
const values = await (await fetch(`${baseUrl}/${guid}/0/value/C1:C2`, { headers })).json();
console.log(values);

// [
//     {
//         x: 2,
//         y: 0,
//         name: "C1",
//         value: null,
//     },
//     {
//         x: 2,
//         y: 1,
//         name: "C2",
//         value: null,
//     },
// ]