跳到主要内容

移动表格行

请求

curl -vvv -X PATCH "$API_HOST/open/api/v1/tablenodes/$table_id/views/$view_id/rows/move/" -H "Content-Type: application/json" -H "Authorization: $access-token"  -d '$request_body'

请求体

{
"items": [
{
"rowID": "6457589faf1c21691b34dab4",
"prevRowID": "6457589faf1c21691b34dab3"
}
]
}

参数说明

NameTypeDescriptionRequired
itemsarrayrow arrayY
∟ rowIDstringrow id
∟ prevRowIDstringprevious row id

Python 示例

def move_table_rows(access_token, table_id, view_id, row_id, prev_row_id):
url = '%s/open/api/v1/tablenodes/%d/views/%s/rows/move/' % (API_HOST, table_id, view_id)
headers = {'Authorization': access_token}
data = {
"items": [
{
"rowID": row_id,
"prevRowID": prev_row_id,
}
]
}
req = requests.patch(url, headers=headers, json=data)
return req.json()

响应

NameTypeDescription
detailobjectmoved row info
∟ resultsobjectrow move result
∟ tableNodeIDint64table id
∟ viewIDstringview id

响应示例

{
"code": 0,
"detail": {
"results": {
"6457589faf1c21691b34dab4": 2.53125
},
"tableNodeID": 18,
"viewID": "645f69d94444eb50dc9d63c3"
},
"extra": null,
"message": "OK",
"requestID": null
}