Config

The configuration defines styles, data, columns and other properties from a spreadsheet.

Documentation

Methods

The following methods are available to interact with the spreadsheet headers programmatically.
MethodDescription
getConfig Get the spreadsheet configuration object.
getConfig(): Promise<Spreadsheet>

GET /api/:guid/config
setConfig Set the spreadsheet configuration.
config:
| Partial<Worksheet>
| {
definedNames?: any;
toolbar?: any;
tabs?: any;
}

@param config - New definitions.

POST /api/:guid/config


Examples

Spreadsheet configuration

Get the configuration of the remote spreadsheet by GUID.

NodeJS
PHP
import { Client } from '@jspreadsheet/client';

// Access token
const token = 'MSwzMTJmZWQzMWYyYTI1OWQ5OGVhMWYxOWNhMDNhYWY3ZTA2ZmVmMWQz';

// Spreadsheet Guid
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';

// Create a new client
const client = new Client(token);

// Get the spreadsheet instance
const spreadsheet = client.getSpreadsheet(guid);

// Request configuration
spreadsheet.getConfig().then((config) => {
    console.log(config);
});
<?php
require 'vendor/autoload.php';

use jspreadsheet\Jspreadsheet;

// Access token
$token = 'MSwzMTJmZWQzMWYyYTI1OWQ5OGVhMWYxOWNhMDNhYWY3ZTA2ZmVmMWQz';

// Spreadsheet Guid
$guid = '15eb1171-5a64-45bf-be96-f52b6125a045';

// Create a new client
$client = new Jspreadsheet($token);

// Get the spreadsheet instance
$spreadsheet = $client->getSpreadsheet($guid)->getConfig();

print_r($data);

Manual request

Alternatively, you can get the configuration of the online spreadsheets using the following route:
// Get the configuration properties of the first spreadsheet worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/config

Set config

set the config of a spreadsheet

NodeJS
PHP
import { Client } from '@jspreadsheet/client';

// Access token
const token = 'MSxlMjE2MWI5YWNjYTg2MzM4MThmN2Y4NjY0YmQzYzBlOGExMmVkZjVk';

// Spreadsheet Guid
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';

// Create a new client
const client = new Client(token);

// Get the spreadsheet instance
const spreadsheet = client.getSpreadsheet(guid);

spreadsheet
    .setConfig({
        toolbar: false,
    })
    .then(() => {
        // It worked correctly
    }).catch((err) => {
        // Something went wrong
        console.log(err);
    });