Move table row
Request
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'
Request example
{
"items": [
{
"rowID": "6457589faf1c21691b34dab4",
"prevRowID": "6457589faf1c21691b34dab3"
}
]
}
Parameter description
Name | Type | Description | Required |
---|---|---|---|
items | array | row array | Y |
∟ rowID | string | row id | |
∟ prevRowID | string | previous row id |
Python example
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()
Response
Name | Type | Description |
---|---|---|
detail | object | moved row info |
∟ results | object | row move result |
∟ tableNodeID | int64 | table id |
∟ viewID | string | view id |
Response example
{
"code": 0,
"detail": {
"results": {
"6457589faf1c21691b34dab4": 2.53125
},
"tableNodeID": 18,
"viewID": "645f69d94444eb50dc9d63c3"
},
"extra": null,
"message": "OK",
"requestID": null
}