Spreadsheet Headers

Documentation

getHeaders

Get the header title by column number.

Parameter Description
column Zero-based column number. If omitted, returns the titles of all columns.

GET /api/:guid/:worksheetIndex/header/:columns

setHeader

Set a custom header title.

Parameter Description
title New title.
column Zero-based column number.

POST /api/:guid/:worksheetIndex/header

Examples

Change the title of a column

const baseUrl = 'https://your-server.example.com/api';
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
const headers = { 'Authorization': `Bearer ${token}` };

// Change the header title for the first column
await fetch(`${baseUrl}/${guid}/0/header`, {
    method: 'POST',
    headers,
    body: new URLSearchParams({
        'column': '0',
        'title': 'New title',
    }),
});

Get the current column titles

const baseUrl = 'https://your-server.example.com/api';
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
const headers = { 'Authorization': `Bearer ${token}` };

// Get the titles of all columns
const titles = await (await fetch(`${baseUrl}/${guid}/0/header`, { headers })).json();

console.log(titles);

Get the title of one column

const baseUrl = 'https://your-server.example.com/api';
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
const headers = { 'Authorization': `Bearer ${token}` };

// Get the title of the second column
const titles = await (await fetch(`${baseUrl}/${guid}/0/header/1`, { headers })).json();

console.log(titles);

// ["B"]