Skip to main content

Get table details

Use this API to get table details, including Meta information (column format, name, and view) and data rows. This API returns at most 500 rows; if there is over 500 rows in the table, use lastSegmentRowID as the offset.

If lastSegmentRowID is empty (1-500 data reads), then both Meta information and data rows are returned; otherwise, only data rows are returned.

Request

curl -vvv "$API_HOST/open/api/v1/tablenodes/$id/partial/" -H "Content-Type: application/json" -H "Authorization: $access-token" -d '{}'

Response

NameTypeRequriedDescription
viewIDstringNOView ID,blank for the default view
lastSegmentRowIDstringNOThe offset of table rows

Response example

{
lastSegmentRowID: "5349b4ddd2781d08c09890f3",
viewID: "5349b4ddd2781d08c09890f3"
}

Python example

def read_table(access_token, table_id, view_id, last_rowid):
url = '%s/open/api/v1/tablenodes/%d/partial/' % (API_HOST, table_id)
data = {}
if view_id:
data['viewID'] = view_id
if last_rowid:
data['lastSegmentRowID'] = last_rowid
headers = {'Authorization': access_token}
req = requests.get(url, json=data, headers=headers)
return req.json()

Response

Response body

NameTypeDescription
detailobjectTable detail
∟ idint64Table ID
∟ typestringTable type: table, bigTable, group
∟ segmentTypestringsegmentStart if this is the 1st partition of table, segmentFrame otherwise
∟ morebooleanIs this partition hit the end of table
∟ columnsarrayColumn data, return when segmentType == segmentStart
∟ rowsarrayRow data
∟ viewsarrayView list, return when segmentType == segmentStart
∟ rowsarrayView rows
∟ columnsarrayView columns

Response body example

{
"code": 0,
"msg": "success",
"detail": {
"id": 1,
"type": "table",
"segmentType": "segmentStart",
"rows": [
{
"id": "61ca7730aeb6fdcb5a6cfcd5",
"cells": {
"620a0e9ef5f9e0fbec16049e": "Tanghekou Town",
"620a0e9ef5f9e0fbec16049f": 2
},
"meta": {
"createTime": "0001-01-01T00:00:00Z",
"updateTime": "0001-01-01T00:00:00Z",
"creatorID": 0,
"updaterID": 0
}
},
"columns": [
{
"id": "620a0e9ef5f9e0fbec16049e",
"syncedID": "000000000000000000000000",
"tableNodeID": 0,
"name": "a",
"type": "singleLineText",
"typeOptions": null,
"isPrimary": true,
"mode": "normal",
"meta": {
"createTime": "0001-01-01T00:00:00Z",
"updateTime": "0001-01-01T00:00:00Z",
"creatorID": 0,
"updaterID": 0
}
}
],
"views": [
{
"id": "620a0e9ef5f9e0fbec16049d",
"name": "New view",
"order": 1,
"frozenColumnCount": 1,
"filterCondition": "and",
"filters": [],
"groups": null,
"orders": null,
"rows": [
{
"id": "61ca7730aeb6fdcb5a6cfcd5",
"order": 1
},
{
"id": "61ca7730aeb6fdcb5a6cfcd6",
"order": 2
},
{
"id": "61ca7730aeb6fdcb5a6cfcd7",
"order": 3
}
],
"columns": [
{
"id": "620a0e9ef5f9e0fbec16049e",
"order": 1,
"width": 200,
"isHidden": false
},
{
"id": "620a0e9ef5f9e0fbec16049f",
"order": 2,
"width": 200,
"isHidden": false
}
]
}
]
}
}