跳到主要内容

获取工作区详情

使用该接口可以获取指定工作区的详情,其中包括工作区信息、项目列表、项目中的数据表列表

请求

curl -vvv "$API_HOST/open/api/v1/workspaces/$type/$id/" -H "Authorization: $access-token"

Python 示例

def get_workspace_detail(access_token, workspace):
url = '%s/open/api/v1/workspaces/%s/%d/' % (API_HOST, workspace['type'], workspace['id'])
headers = {'Authorization': access_token}
req = requests.get(url, headers=headers)
return req.json()

响应

响应体

NameTypeDescription
detailobjectWorkspace info
∟ currentUserobjectUser info
∟ projectsarrayProject list
∟ recycleProjectsarrayProjects in the trash
∟ dataFilesarrayDataset list
∟ recycleDataFilesarrayDatasets in the trash
∟ unreadNotificationsCountint64Unread notifications count

项目列表

NameTypeDescription
projectsarrayProject list
∟ idint64Project ID
∟ namestringProject name
∟ descstringProject description
∟ iconstringProject icon
∟ updateTimestringProject updated time
∟ createTimestringProject created time
∟ memberCountstringProject member count
∟ creatorobjectProject creator
∟ idint64Project creator ID
∟ namestringProject creator name
∟ avatarstringProject creator avatar
∟ tableNodesarrayTables in projects
数据表列表
名称类型描述
tableNodesarray数据表列表
∟ idint64数据表 ID
∟ namestring名称
∟ typestring类型: table, bigTable, group
∟ subscribedboolean是否为订阅表
∟ publishedboolean是否已发布为订阅源
∟ createTimestring创建时间

响应体示例

{
"code": 0,
"detail": {
"type": "user",
"detail": {
"currentUser": {
"id": 16,
"name": "587****9399",
"avatar":null },
"projects": [
{
"id": 55,
"name": "Example Project",
"icon": "mapPin",
"desc": "Example Project",
"creator": {
"id": 16,
"name": "587****9399",
"avatar":null },
"updateTime": "2022-04-07T17:24:47.590592+08:00",
"createTime": "2022-04-07T17:24:47.590591+08:00",
"roleInherited":false,
"tableNodes": [
{
"id": 434,
"name": "Parcel List",
"type": "table",
"order": 1,
"parentID":null,
"subscribed":false,
"published":false,
"roleInherited":true,
"createTime": "2022-04-07T17:24:47.611129+08:00",
"updateTime": "2022-04-07T17:24:47.61113+08:00"
},
{
"id": 435,
"name": "Hangzhou Zone1",
"type": "table",
"order": 2,
"parentID":null,
"subscribed":false,
"published":false,
"roleInherited":true,
"createTime": "2022-04-07T17:24:47.636041+08:00",
"updateTime": "2022-04-14T17:47:28.752613+08:00"
}
],
"recycleTableNodes":null,
"mapConfig": {
"center": "120.209276,30.247413",
"zoomLevel": 10,
"positioning":false,
"ranging":true,
"isSet":true,
"baseMap": "AmapLight",
"shareToken": "",
"isShared":false },
"memberCount": 1
}
],
"recycleProjects":null,
"dataFiles":null,
"recycleDataFiles":null,
"unreadNotificationsCount": 0
}
},
"extra":null,
"message": "OK",
"requestID":null
}