Get a window of table rows
https://table.prod.thinkalpha.io/snapshot/{sym}:{ex}Returns a one-time snapshot of a window of rows from a table: the column descriptors, the table's total row count, and up to window_size rows starting at first_row. The response is sent once the whole window has been read; it is not streamed, and each call reads the table's current contents independently.
The caller must be allowed to read the table key sym:ex. Send a proxy access cookie that names the key as the Bearer value, or authenticate as a superuser using a bearer identity token or HTTP Basic client credentials, who can read every key. A user bearer token or a client-credentials token from a non-superuser carries no table access by itself and needs the cookie. Table keys are written sym:ex; the proxy splits the key at the last colon, so percent-encode any colon inside sym.
If the table does not exist yet, the request waits up to timeout seconds (default 5) for it to appear. Once it exists, the table server has at least 20 seconds, or timeout seconds when that is larger, to produce the snapshot. When either wait runs out the request fails with HTTP 500 and code Timeout.
Set window_size=0 to read only the column descriptors and total_row_count, for example to size a scroll bar or count the symbols in a universe. To follow a table's changes as they happen, or to page through it with diffs, use the socket protocol (Subscribe with a pull or stream mode) instead of calling this operation repeatedly. If a query parameter appears more than once, the first value is used.
- Operation ID
- getSnapshot
- Authentication
- accessToken or proxyAccessCookie or basicAuth
Path parameters
- sym string required
First part of the table key: the table's name. Percent-encode it if it contains reserved characters such as `#` or `:`. The key is split at the last colon of the path segment.
min length 1 - ex string required
Second part of the table key: the exchange suffix after the last colon, for example `T`. Must not be empty.
min length 1
Query parameters
- first_row integer required
Zero-based index of the first row to return. `0` starts at the top of the table. Must be a non-negative integer.
>= 0<= 4294967295 - window_size integer required
Maximum number of rows to return, starting at `first_row`. Use `0` to return no rows and read only the column descriptors and `total_row_count`. Must be a non-negative integer.
>= 0<= 4294967295 - timeout integer
Seconds to wait for the table to exist and be reachable (default 5). Once it is, the table server has at least 20 seconds to answer, or `timeout` seconds if that is larger. When either wait runs out the request fails with HTTP 500 and code `Timeout`.
>= 0<= 255default: 5
Responses
One snapshot of a window of table rows, as plain JSON. Read each row cell by its column name; the matching entry in `descriptors` gives the column's type.
- subscription_id string required
Identifier of this request: the `sub_id` you sent, or a UUID the proxy generated when you sent none.
- total_row_count integer required
Total number of rows in the table, independent of the requested window. With `window_size=0` this is returned with an empty `rows` array, so you can count rows without fetching them. If no count has arrived, the proxy returns 0.
>= 0<= 4294967295 - px_http_SnapshotDescriptor[] required
One entry per column, in column order. Each key in a row (other than `row_id`) is the `field` of one of these entries.
- px_http_SnapshotDescriptor[]
Columns of the totals row. Present only when the table has a totals (footer) row.
- totals object
The table's totals row, keyed by column name. Present only when the table has a totals row and its values have arrived.
- px_http_SnapshotRow[] required
The requested window of rows, at most `window_size` of them, starting at row `first_row`.