Create table view
Request
curl -vvv "$API_HOST/open/api/v1/tablenodes/$table_id/views/" -H "Content-Type: application/json" -H "Authorization: $access-token" -d '$request_body'
Request example
{
"fromViewID": "645d87141694c57ce7af57c0",
"name": "newView",
"type": "table"
}
Parameter description
Name | Type | Description | Required |
---|---|---|---|
fromViewID | string | source view id | Y |
name | int64 | view name | Y |
type | string | view type: table, form | Y |
Python example
def create_table_view(access_token, table_id, source_view_id, name, type="table"):
url = '%s/open/api/v1/tablenodes/%d/views/' % (API_HOST, table_id)
headers = {'Authorization': access_token}
data = {
"name": name,
"fromViewID": source_view_id,
"type": type
}
req = requests.post(url, headers=headers, json=data)
return req.json()
Response
Name | Type | Description |
---|---|---|
detail | object | created view info |
∟ projectID | int64 | project id |
∟ tableNodeID | int64 | table id |
∟ view | object | view info |
View Information
Name | Type | Description |
---|---|---|
view | object | view info |
∟ allowSubscribe | bool | whether allow subscribe |
∟ backgroundColor | string | background color |
∟ columns | array | view columns info |
∟ desc | string | view description |
∟ disableShareExport | bool | whether disable share export |
∟ filterCondition | string | filter condition |
∟ filters | array | view filters |
∟ frozenColumnCount | int64 | frozen column number |
∟ groups | array | view groups |
∟ id | int64 | view id |
∟ isShared | bool | whether shared |
∟ name | string | view name |
∟ order | int64 | view order |
∟ orders | array | view group order |
∟ rowHeight | string | row height: low, middle, high |
∟ rows | array | rows info |
∟ sharePassword | string | share password |
∟ shareToken | string | share token |
∟ subscriberCount | int64 | subscriber number |
∟ type | array | type : table, form |
∟ useSharePassword | bool | whether user share password |
Response example
{
"code": 0,
"detail": {
"projectID": 16,
"tableNodeID": 73,
"view": {
"allowSubscribe": false,
"backgroundColor": "",
"columns": [
{
"desc": null,
"id": "645d87151694c57ce7af57c2",
"isHidden": false,
"order": 2,
"required": false,
"statsOption": null,
"title": null,
"width": 200
},
{
"desc": null,
"id": "645d87151694c57ce7af57c1",
"isHidden": false,
"order": 1,
"required": false,
"statsOption": null,
"title": null,
"width": 200
},
{
"desc": null,
"id": "645d87151694c57ce7af57c3",
"isHidden": false,
"order": 3,
"required": false,
"statsOption": null,
"title": null,
"width": 200
},
{
"desc": null,
"id": "645d87151694c57ce7af57c5",
"isHidden": false,
"order": 5,
"required": false,
"statsOption": null,
"title": null,
"width": 200
},
{
"desc": null,
"id": "645d87151694c57ce7af57c6",
"isHidden": false,
"order": 6,
"required": false,
"statsOption": null,
"title": null,
"width": 200
},
{
"desc": null,
"id": "645d87151694c57ce7af57c4",
"isHidden": false,
"order": 4,
"required": false,
"statsOption": null,
"title": null,
"width": 200
}
],
"desc": "",
"disableShareExport": false,
"filterCondition": "and",
"filters": null,
"frozenColumnCount": 1,
"groups": null,
"id": "645f3d0e4444eb50dc9d63af",
"isShared": false,
"name": "newView",
"order": 3,
"orders": null,
"rowHeight": "low",
"rows": [
{
"id": "645d87151694c57ce7af57ca",
"order": 4
},
{
"id": "645d87151694c57ce7af57cc",
"order": 6
},
{
"id": "645d87151694c57ce7af57c9",
"order": 3
},
{
"id": "645d87151694c57ce7af57ce",
"order": 8
},
{
"id": "645d87151694c57ce7af57cb",
"order": 5
},
{
"id": "645d87151694c57ce7af57c7",
"order": 1
},
{
"id": "645d87151694c57ce7af57d0",
"order": 10
},
{
"id": "645d87151694c57ce7af57cd",
"order": 7
},
{
"id": "645d87151694c57ce7af57c8",
"order": 2
},
{
"id": "645d87151694c57ce7af57cf",
"order": 9
}
],
"sharePassword": "jvLU",
"shareToken": "clabgenwipz4",
"subscriberCount": 0,
"type": "table",
"useSharePassword": false
}
},
"extra": null,
"message": "OK",
"requestID": null
}