跳到主要内容

获取项目详情

获取指定项目的详细信息

请求

curl -vvv "$API_HOST/open/api/v1/projects/$project_id/" -H "Authorization: $access-token"

Python 示例

def get_project_detail(access_token,project_id):
url = '%s/open/api/v1/projects/%d/' % (API_HOST, project_id)
headers = {'Authorization': access_token}
req = requests.get(url, headers=headers)
return req.json()

# get first project in workspace
workspace = ma.openapi_list_workspaces(access_token)["detail"][0]
ws_detail= ma.get_workspace_detail(access_token, workspace)
project = ws_detail['detail']['detail']['projects'][0]

resp = ma.get_project_detail(access_token,project["id"])

响应

NameTypeDescription
detailarrayProject Detail Info
∟ idint64project id
∟ namestringproject name
∟ iconstringproject icon
∟ descstringproject description
∟ timezonestringproject timezone
∟ creatorobjectproject creator info
∟ updateTimestringproject update time
∟ createTimestringproject create time
∟ roleInheritedboolwhether inherited permissions
∟ tableNodesarraytables in project
∟ recycleTableNodesarraytables in the trash
∟ mapConfigobjectproject map config info
∟ memberCountint64project members number

响应体示例

{
"code": 0,
"detail": {
"id": 16,
"name": "projectName",
"icon": "todo",
"desc": "project description",
"timezone": "Asia/Shanghai",
"creator": {
"id": 1,
"name": "n***@elgo.cc",
"avatar": null
},
"updateTime": "2023-05-12T08:23:48.766653+08:00",
"createTime": "2023-05-12T08:23:48.766652+08:00",
"roleInherited": false,
"tableNodes": [
{
"id": 73,
"name": "新建数据表",
"type": "table",
"order": 1,
"parentID": null,
"subscribed": false,
"published": false,
"roleInherited": true,
"createTime": "2023-05-12T08:23:48.768107+08:00",
"updateTime": "2023-05-12T08:23:52.262989+08:00"
},
{
"id": 75,
"name": "table-copy",
"type": "table",
"order": 2,
"parentID": null,
"subscribed": false,
"published": false,
"roleInherited": true,
"createTime": "2023-05-12T08:23:51.516848+08:00",
"updateTime": "2023-05-12T08:23:52.26389+08:00"
},
{
"id": 74,
"name": "table-test",
"type": "table",
"order": 3,
"parentID": null,
"subscribed": false,
"published": false,
"roleInherited": true,
"createTime": "2023-05-12T08:23:50.01376+08:00",
"updateTime": "2023-05-12T08:23:52.264768+08:00"
}
],
"recycleTableNodes": null,
"mapConfig": {
"center": "108.928439,34.539281",
"zoomLevel": 10,
"positioning": false,
"ranging": true,
"isSet": false,
"is3D": false,
"bearing": 0,
"pitch": 0,
"baseMap": "AmapLight",
"title": null,
"desc": null,
"shareToken": "",
"isShared": false,
"sharePassword": "",
"useSharePassword": false
},
"memberCount": 2
},
"extra": null,
"message": "OK",
"requestID": null
}