Api session event editor excelsheet set matrix

From Tygron Support wiki
Jump to navigation Jump to search

API Endpoint: api/session/event/editorexcelsheet/set_matrix/

Description: Set existing Excel Sheet based on matrix (rows and columns) containing the values and formulas for each cell and a second with optional labels.

Index Importance Type Description Values
0 REQUIRED (Integer number) Name
1 REQUIRED (Object or multiple values in array [a, b, c]) Matrix containing content (numeric value, text of formula starting with =) for each cell.
2 REQUIRED (String or multiple values in array ["a", "b", "c"] or matrix [["a", "b"], ["c", "d"], ["e", "f"]]) Matrix containing labels for each cell, may be empty.
3 REQUIRED (String) Uploader Name

Response Codes

Response Code: Description
200 Excel ID
300-600 Codes Overview

Example POST

Curl example POST

curl 'https://engine.tygron.com/api/session/event/editorexcelsheet/set_matrix/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ 1, [ 1, "TEXT" ], [ "A1", "B1" ], "Uploader Name" ]'

Curl example multi item POST

curl 'https://engine.tygron.com/api/session/event/editorexcelsheet/set_matrix/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ 1, [ [ 1, "TEXT" ], [ 3, "TEXT" ], [ 5, "TEXT" ] ], [ [ "A1", "B1" ], [ "A2", "B2" ], [ "A3", "B3" ] ], "Uploader Name" ]'

JavaScript example POST

var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
 body: '[ 1, [ 1, "TEXT" ], [ "A1", "B1" ], "Uploader Name" ]'
};
fetch("https://engine.tygron.com/api/session/event/editorexcelsheet/set_matrix/", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));