Jspreadsheet Cloud

The Client API

The Jspreadsheet Cloud API is a PHP library to make it possible to publish actions from the backend to the spreadsheet interface and connect its data with any other application. With the API and Jspreadsheet Cloud you would be able to create amazing real-time solutions, such as:

  • Real-time spreadsheet
  • Transform simple spreadsheets in live database relational applications
  • Data persistence and automatic backups
  • Serverless spreadsheets

To use this API you should have a Jspreadsheet Cloud Account where you can generate your secret Access Key and create your online spreadsheets.



Getting started

The Jspreadsheet Client API is available in PHP.

% composer install jspreadsheet/client


Account and Keys

To connect to your spreadsheet and data, you will need the API key and a spreadsheet identifier. The secret API key can be generated using your Jspreadsheet Account. With this key, you can perform any read and write actions to your spreadsheets and data, so it should be used wisely. Non authorized use of your key can create a lot of problems, so be cautious. You are responsible to keep it safe.


Secret Key

You can generate or regenerate your API key on your Jspreadsheet Profile Account.




Unique spreadsheet identifier

You can create a new spreadsheet from your workspace.



Create your first example

Before start please make sure the spreadsheet has public visibility or, you have the appropriate permissions. For the study of the data operations, please consider the following public spreadsheet.

<?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)->getColumns()->getWidth();

// Result [40, 40, 45]


Manual request

If you are using any other language, you can implement the GET and POST requests to the appropriate routes, as follow:
// Get the spreadsheet configuration
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/config

// Create a new spreadsheet
https://jspreadsheet.com/api/create

// Get the spreadsheet json definition including all worksheets
https://jspreadsheet.com/api/c3914fd1-c295-46e2-bca6-55d3fc80f508

// Get the spreadsheet json definition of the second worksheet only - starts on zero
https://jspreadsheet.com/api/c3914fd1-c295-46e2-bca6-55d3fc80f508,1

// Download the spreadsheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/download

// Create a new worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/create

// Get the configuration properties of the first worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/config

// Get the configuration properties of the second worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045,1/config

// Get the data of the first worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045,0/data

// Get the data of the second worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045,1/data

// Get the data of one specific row in the first worksheet (default to the first worksheet)
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/data/row/[rowNumber]

// Get the data of one specific column in the second worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045,1/data/columns/[colNumber]

// Get data by Range
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/data/range/A1:E1

// Get value from columns or by range from the first worksheet 
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/value/A1,B1,B3
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/value/A1:E10

// Get the value by range from the second worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045,1/value/A1:E10

// Get all meta information from the first worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/meta

// Get the width array of the first worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/width

// Get all row height defined in the first worksheet 
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/height

// Get all comments from the second worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045,1/comments

// Get the style of the whole first worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/style

// Reset the style of the first worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/style/reset

// Reset the style of the two cells in the first worksheet
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/style/reset/A2,B1
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/merge
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/merge/reset
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/type
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/row/insert
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/row/delete
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/row/move
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/column/insert
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/column/delete
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/column/move
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/column/order
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/headers
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/headers/nested
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/footers
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/footers/reset
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/worksheets/create
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/worksheets/rename
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/worksheets/delete
https://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045/worksheets/move