POST
/
v1
/
workbooks
/
{id}
/
query
import Grid from '@grid-is/api';

const client = new Grid();

async function main() {
  const response = await client.workbooks.query('id', { read: ['A1', 'Sheet2!B3', '=SUM(A1:A4)'] });

  console.log(response.apply);
}

main();
{
  "apply": [
    {
      "target": "<string>",
      "value": 123,
      "originalValue": 123
    }
  ],
  "goalSeek": {
    "targetCell": "<string>",
    "targetValue": 123,
    "controlCell": "<string>",
    "solution": 123
  },
  "read": [
    {
      "source": "<string>",
      "type": "dataTable",
      "data": [
        [
          {
            "r": "<string>",
            "t": "b",
            "v": 123,
            "z": "<string>",
            "w": "<string>"
          }
        ]
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Body

application/json

Defines a request to read workbook data and, optionally, apply temporary changes. It includes read (required cell references or formulas), apply (optional transient updates to cells), and options (optional settings for data structure, format, and references).

read
string[]
required

Cell references to read from the workbook and return to the client

Example:
["A1", "Sheet2!B3", "=SUM(A1:A4)"]
options
object | null

Options to choose the format and structure of the returned data

apply
object[] | null

Cells to update before reading. Note that the API has no state and any changes made are cleared after each request

Specifies a temporary change to a workbook cell, including the target cell reference and the value to apply. The API has no state, and so any changes made are cleared after each request.

Example:
[{ "target": "A2", "value": 1234 }]
goalSeek
object | null

Goal seek. Use this to calculate the required input value for a formula to achieve a specified target result. Useful when the desired outcome is known, but the corresponding input is not

Response

200
application/json
Successful Response

Contains the results of a workbook query, including read (queried cell data) and apply (details of temporary changes applied). Note that the API has no state and any changes made are cleared after each request.

apply
object[] | null
required

Confirmation of the changes that were applied to the spreadsheet. Note that the API has no state and any changes made are cleared after each request

Details temporary changes made during a query, including the target cell, the new value, and the originalValue before the change. Note that the API has no state and any changes made are cleared after each request.

read
object[]
required

Details on the values that were read from the workbook cells

Read data format used when options are { "structure": "table", "values": "full" }.

goalSeek
object | null

Results of the goal seek operation