GoliathDevelopersGet an API key
Reference/Spacesgenerated from the gateway manifest

readSpaceSheet

A spreadsheet's cells.

POST/api/v1/callREADreadruns as the key's owner
View as Markdown

A spreadsheet's cells (.xlsx, CSV, TSV) by A1 range (any size, any sheet) instead of reading it whole: range B2:F40, C7, A:C (whole columns) or 5:9 (whole rows), default every filled cell; sheet by name, default the first. Rows come tab-separated, each led by its row number under a line of column letters, a formula as =SUM(B2:B9) → 1200 (formula, then the value it shows); a range below row 1, or a find, shows row 1 first so the columns are named. Up to 12000 characters a page: nextStartRow says where to read on. find (a few words, case-insensitive) keeps only the rows holding one, with matchedRows counting them all. sheets lists every sheet's size; truncated means the sheet goes on past the 200,000 rows or 500 columns a read reaches. A formula over another sheet shows the value Excel last saved. Pass the result's versionId as baseVersionId to editSpaceSheetCells.

curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "readSpaceSheet",
    "variables": {
      "itemId": "<itemId>"
    }
  }'
import { GoliathClient } from '@goliath-data/sdk'

const goliath = new GoliathClient({
  apiKey: process.env.GOLIATH_API_KEY!,
  baseUrl: 'https://server.goliathdata.com',
})

const result = await goliath.spaces.readSpaceSheet({
  itemId: '<itemId>'
})
const res = await fetch('https://server.goliathdata.com/api/v1/call', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    operationId: 'readSpaceSheet',
    variables: {
      itemId: '<itemId>'
    }
  }),
})
const { data, errors } = await res.json()

Variables

The example sends only what the schema requires. Some operations also need one of several optional variables (one filter or another, say); the description above says which.

itemIdID!required
versionIdID
sheetString
rangeString
find[String!]
maxCharsInt

Response

What comes back under data: a list shows as one entry, and a value as its type.

response shape
{
  "data": {
    "spacesQuery": {
      "sheetRange": {
        "versionId": "<ID>",
        "sheets": [
          {
            "name": "…",
            "rowCount": 0,
            "columnCount": 0
          }
        ],
        "sheet": "…",
        "range": "…",
        "rowCount": 0,
        "columnCount": 0,
        "text": "…",
        "matchedRows": 0,
        "nextStartRow": 0,
        "truncated": true
      }
    }
  }
}

Errors

Behaviour

A read. It rejects an Idempotency-Key header with 400 bad_request.