Update table column
Request
curl -vvv -X PATCH "$API_HOST/open/api/v1/tablenodes/$table_id/columns/$column_id/" -H "Authorization: $access-token" -d '$request_body'
Request example
{
"name": "newColumnName",
"desc": "description",
"type": "number",
"typeOptions": {}
}
Parameter description
Name | Type | Description | Required |
---|---|---|---|
name | string | column name | |
desc | string | description | |
type | string | column type | |
typeOptions | object | column type options |
Python example
def update_table_column(access_token, table_id, column_id,name,type_options):
url = '%s/open/api/v1/tablenodes/%d/columns/%s/' % (API_HOST, table_id, column_id)
headers = {'Authorization': access_token}
data = {
"name": name,
"typeOptions": type_options,
}
req = requests.patch(url, headers=headers, json=data)
return req.json()
Response
Name | Type | Description |
---|---|---|
detail | object | updated column info |
∟ columnID | string | column id |
∟ invalidedColumns | array | invalid column id array |
∟ projectID | int64 | project id |
∟ tableNodeID | int64 | table id |
∟ updatedCells | object | updated cells |
∟ updatedFields | object | updated fields |
Response example
{
"code": 0,
"detail": {
"columnID": "645f545d4444eb50dc9d63b6",
"invalidedColumns": [],
"projectID": 16,
"tableNodeID": 73,
"updatedCells": {
"645d87151694c57ce7af57c7": {},
"645d87151694c57ce7af57c8": {},
"645d87151694c57ce7af57c9": {},
"645d87151694c57ce7af57ca": {},
"645d87151694c57ce7af57cb": {},
"645d87151694c57ce7af57cc": {},
"645d87151694c57ce7af57cd": {},
"645d87151694c57ce7af57ce": {},
"645d87151694c57ce7af57cf": {},
"645d87151694c57ce7af57d0": {}
},
"updatedFields": {
"name": "新字段5",
"typeOptions": null
}
},
"extra": null,
"message": "OK",
"requestID": null
}