创建表格行
请求
curl -vvv "$API_HOST/open/api/v1/tablenodes/$table_id/rows/" -H "Content-Type: application/json" -H "Authorization: $access-token" -d '$request_body'
请求体
{
"cells": {
"6457589faf1c21691b34dab1":"312e9c2d153a853fb2d530fab21a242x",
"6457589faf1c21691b34dab2":"SunnyCity"
},
"prevRowId": "6457589faf1c21691b34dab3"
}
参数说明
Name | Type | Description | Required |
---|---|---|---|
cells | object | row cell info | Y |
prevRowId | string | previous row id |
Python 示例
def create_table_row(access_token, table_id, cells, prev_row_id):
url = '%s/open/api/v1/tablenodes/%d/rows/' % (API_HOST, table_id)
headers = {'Authorization': access_token}
data = {
"cells": cells,
"prevRowId": prev_row_id
}
req = requests.post(url, headers=headers, json=data)
return req.json()
响应
Name | Type | Description |
---|---|---|
detail | object | created row info |
∟ addedViewRows | array | added view rows info |
∟ cells | object | added cell info |
∟ id | string | row id |
∟ tableNodeID | int64 | table id |
响应示例
{
"code": 0,
"detail": {
"addedViewRows": [
{
"id": "645f63f24444eb50dc9d63c1",
"order": 2.5625,
"viewID": "64575895af1c21691b34dab0"
}
],
"cells": {
"6457589faf1c21691b34dab1": "312e9c2d153a853fb2d530fab21a242x",
"6457589faf1c21691b34dab2": "SunnyCity"
},
"id": "645f63f24444eb50dc9d63c1",
"tableNodeID": 18
},
"extra": null,
"message": "OK",
"requestID": null
}