Skip to main content

Copy table

Request

  curl -vvv "$API_HOST/open/api/v1/tablenodes/$table_id/copies/" -H "Content-Type: application/json" -H "Authorization: $access-token"  -d '$request_body'

Request example

    {
"projectID": 2,
"name": "newTableName",
"includeData": true,
"IncludePermission": true
}

Parameter description

NameTypeDescriptionRequired
namestringtable nameY
projectIDint64project idY
includeDataboolwhether include data
IncludePermissionboolwhether include permission

Python example

def copy_table(access_token, project_id, table_id, name, include_data, include_permission):
url = '%s/open/api/v1/tablenodes/%d/copies/' % (API_HOST, table_id)
headers = {'Authorization': access_token}
data = {
"name": name,
"projectID": project_id,
"includeData": include_data,
"IncludePermission": include_permission
}
req = requests.post(url, headers=headers, json=data)
return req.json()

Response

NameTypeDescription
detailobjectcreated table info
∟ idint64table id
∟ namestringtable name
∟ typestringtable type
∟ orderint64table order
∟ createTimestringtable create time
∟ updateTimestringtable last updated time
∟ parentIDint64table group id
∟ projectIDint64project id
∟ publishedboolwhether published
∟ roleInheritedboolwhether inherited permissions
∟ subscribedboolwhethere subscribed

Response example

{
"code": 0,
"detail": {
"id": 77,
"name": "newTableName",
"type": "table",
"order": 31,
"parentID": null,
"projectID": 14,
"subscribed": false,
"published": false,
"roleInherited": true,
"createTime": "2023-05-13T12:28:28.047773+08:00",
"updateTime": "2023-05-13T12:28:28.047773+08:00"
},
"extra": null,
"message": "OK",
"requestID": null
}