跳到主要内容

新建数据表

创建新的数据表

请求

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

请求体

{
"name": "tableName",
"projectID": 2,
"parentID":35,
"type": "table"
}

参数说明

NameTypeDescriptionRequired
namestringtable nameY
projectIDint64project idY
parentIDint64table group id
typestringtable type: table, groupY

Python 示例

def new_table(access_token, project_id, parent_id, name, type):
url = '%s/open/api/v1/tablenodes/' % API_HOST
headers = {'Authorization': access_token}
data = {
"name": name,
"projectID": project_id,
"parentId": parent_id,
"type": type
}
req = requests.post(url, headers=headers, json=data)
return req.json()

响应

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

响应示例

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