Spreadsheet sharing

This section explains more about the sharing.

Documentation

Methods

Methods related to the spreadsheet sharing and users management and permissions.
MethodDescription
getUsers Get all the users invited for a online spreadsheet.
getUsers(): Promise<{
name: string;
email: string;
title: string;
level: number;
token: string;
}>


GET /api/:guid/users
setUsers Add a new user to the spreadsheet.
setUsers(
users: { email: string; level: number }[]
): Promise<{ email: string; token: string }[]>

@param users[].email - user email.
@param users[].level - user level.

POST /api/:guid/users
updateUsers Update a user from the spreadsheet.
updateUsers(users: { email: string; level: number }[]): Promise<void>
@param users[].email - user email.
@param users[].level - user level.

POST /api/:guid/users/update
deleteUsers Delete one or more users from the spreadsheet.
deleteUsers(users: string | string[]): Promise<void>
@param users - emails of users that should be removed.

POST /api/:guid/users/delete

Examples

Invitations

Get all users invited for a online 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);

// Request data
spreadsheet.getUsers().then((data) => {
    // List of users invited for a spreadsheet
    console.log(data);
});
// Not available in the PHP client library.