Spreadsheet Headers
This section covers the routes to handle the spreadsheet headers.
Documentation
getHeaders
Get the header title by column number.
| Parameter | Description |
|---|---|
column |
Get the header title by column number starting on zero. If no value is passed, returns the titles of all columns. |
GET /api/:guid/:worksheetIndex/header/:columns
setHeader
Set a custom header title.
| Parameter | Description |
|---|---|
title |
New title. |
column |
Column number starting on zero. |
POST /api/:guid/:worksheetIndex/header
Examples
How to 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 from a specified column number
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"]