Others
This section covers methods not covered by the other sections.
Documentation
Section titled “Documentation”Methods
Section titled “Methods”| Method | Description |
|---|---|
| getConfig | Get spreadsheet config. Jspreadsheet getConfig(): Promise<Spreadsheet> GET /api/:guid |
| delete | Delete spreadsheet. Jspreadsheet delete(): Promise<void> DELETE /api/:guid |
Examples
Section titled “Examples”Get config
Section titled “Get config”import { Client } from "@intrasheets/client";
// Create a new clientconst client = new Client({ // API Server baseUrl: "http://localhost:8009/api", // Your authentication token token: "eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i",});
// Spreadsheet Guidconst guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
// Get the spreadsheet instanceconst spreadsheet = client.getSpreadsheet(guid);
// Set spreadsheet configspreadsheet.getConfig().then((config) => { console.log(config);});curl -X GET "http://localhost:8009/api/15eb1171-5a64-45bf-be96-f52b6125a045" \ -H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i"Manual request
Section titled “Manual request”You can get the configuration of the online spreadsheets using the following route:
// Get the configuration properties of the spreadsheethttps://jspreadsheet.com/api/15eb1171-5a64-45bf-be96-f52b6125a045Delete spreadsheet
Section titled “Delete spreadsheet”import { Client } from "@intrasheets/client";
// Create a new clientconst client = new Client({ // API Server baseUrl: "http://localhost:8009/api", // Your authentication token token: "eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i",});
// Spreadsheet Guidconst guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
// Get the spreadsheet instanceconst spreadsheet = client.getSpreadsheet(guid);
// Delete spreadsheetspreadsheet.delete().then(() => { console.log("deleted");});curl -X DELETE "http://localhost:8009/api/15eb1171-5a64-45bf-be96-f52b6125a045" \ -H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i"