[starting from version: 2.8]
A request for data.
{ "type": "select" "index": string, "query": { "fields"[]: FieldObject, "filter": FilterObject[] | FilterGroupObject, "limit": number }, "page": number }
The request has the following parameters:
type
— String. The type of the request. In this case, it is "select"
.index
– String. The dataset identifier. query
– Object. A query object. Contains the following properties:fields
– Array of FieldObjects. An array of fields (columns) to include in the response. filter
optional – Array of FilterObjects | FilterGroupObject. Query filters. The part of a query that specifies which filters should be applied to the data.false
), the filter’s structure is an array of FilterObjects.2.8.5
or /handshake is not implemented.2.8.22
or later.limit
– Number. The maximum number of records that should be included in the response. Configurable on the client. Default value: 1000
.page
– Number. The page number. It can be used to load data by parts. If the response contains the pageTotal
parameter, additional requests will be performed to load the remaining pages. Starts from 0
.{ "fields"[]: { "uniqueName": string }, "hits"[]: [ (index): string | number ], "page": number, "pageTotal": number }
The response has the following parameters:
fields
– Array of objects. Fields (columns) included in the response. Each object in the array has the following properties: uniqueName
– String. The field’s unique name. hits
– Array. A two-dimensional array containing data:(index)
– String | Number. A data row, where (index)
is a field (column) index.page
optional – Number. The current page number. Starts from 0
.pageTotal
optional – Number. The total number of pages. It can be used to load members by parts.Request:
{ "index": "data-set-123", "type": "select", "query": { "fields": [ { "uniqueName": "country" }, { "uniqueName": "city" }, { "uniqueName": "price" }, { "uniqueName": "quantity" } ], "filter"[]: { "field": { "uniqueName": "country" }, "include": [ { "member": "Canada" } ] }, "limit": 1000 }, "page": 0 }
Response:
{ "fields": [ { "uniqueName": "country" }, { "uniqueName": "city" }, { "uniqueName": "price" }, { "uniqueName": "quantity" } ], "hits": [ ["Canada", "Toronto", 53, 2], ["Canada", "...", 1, 1] ] }
/handshake request
/fields request
/members request
/select request for pivot table
/select request for flat table