跳到主要内容

更新单元格附件

请求

curl -vvv -X PATCH "$API_HOST/open/api/v1/tablenodes/$table_id/rows/$row_id/cells/$column_id/attachments/$attchment_id/" -H "Content-Type: application/json" -H "Authorization: $access-token"  -d '$request_body'

请求体示例

{
"name":"newName.csv"
}

参数说明

NameTypeDescriptionRequired
namestringattachment nameY

Python 示例

def update_attachment(access_token, table_id, row_id, column_id, attachment_id, name):
url = '%s/open/api/v1/tablenodes/%d/rows/%s/cells/%s/attachments/%s/' %( API_HOST, table_id, row_id,column_id,attachment_id)
data = {
"name": name
}
headers = {'Authorization': access_token}
req = requests.patch(url, headers=headers, json=data)
return req.json()

响应

NameTypeDescription
detailobjectattachment info
∟ attachmentsarrayattachment array
∟ columnIDstringcolumn id
∟ fileIDstringfile id
∟ namestringattachment name
∟ projectIDint64project id
∟ rowIDstringrow id
∟ tableNodeIDint64table id

响应示例

{
"code": 0,
"detail": {
"attachments": null,
"columnID": "645f6d304444eb50dc9d63c6",
"fileID": "clatxt69zta8",
"name": "newName.csv",
"projectID": 2,
"rowID": "6457589faf1c21691b34dab3",
"tableNodeID": 40
},
"extra": null,
"message": "OK",
"requestID": null
}