# 说明
获取代码仓库与TAPD关联空间列表(无分页)
# url
https://apiv2.tapd.tencent.com/workspaces/get_relate_git_projects
# 支持格式
JSON/XML(默认JSON格式)
# HTTP请求方式
GET
# 请求数限制
一次返回所有符合条件的值 只能传代码仓库 git_project_id 参数,一次只能查一个仓库
# 请求参数
字段名 | 必选 | 类型及范围 | 默认 | 说明 | 特殊规则 |
---|---|---|---|---|---|
git_project_id | 是 | integer | - | 代码仓库ID | 无 |
all | 否 | integer | 0 | 是否获取所有空间列表 enum(0, 1),值为0时获取最新关联空间,为1表示获取所有关联空间 | 无 |
# 调用示例及返回结果
# 获取 代码仓库ID为9926184关联的空间信息
# curl 使用 OAuth Access Token 鉴权调用示例
curl -H 'Authorization: Bearer ACCESS_TOKEN' 'https://apiv2.tapd.tencent.com/workspaces/get_relate_git_projects?git_project_id=11421734'
# 返回结果
{
"status": 1,
"data": {
"GitProject": {
"id": "1069995211000025073",
"workspace_id": "69995211",
"git_project_id": "11421734",
"git_app_id": "3",
"path_with_namespace": "orangecyang/mini_project_git",
"creator": "orangecyang",
"created": "2023-07-19 13:37:23",
"name": "",
"modified": "2023-07-19 13:37:24",
"status": "1",
"modifier": ""
}
},
"info": "success"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# curl 使用 OAuth Access Token 鉴权调用示例
curl -H 'Authorization: Bearer ACCESS_TOKEN' 'https://apiv2.tapd.tencent.com/workspaces/get_relate_git_projects?git_project_id=9926184'&all=1
# 返回结果
{
"status": 1,
"data": [
{
"GitProject": {
"id": "1069991412000025071",
"workspace_id": "69991412",
"git_project_id": "11421734",
"git_app_id": "3",
"path_with_namespace": "orangecyang/mini_project_git",
"creator": "orangecyang",
"created": "2023-07-19 13:29:40",
"name": "",
"modified": "2023-07-19 13:29:40",
"status": "1",
"modifier": ""
}
},
{
"GitProject": {
"id": "1069993260000025069",
"workspace_id": "69993260",
"git_project_id": "11421734",
"git_app_id": "3",
"path_with_namespace": "orangecyang/mini_project_git",
"creator": "orangecyang",
"created": "2023-07-19 12:21:19",
"name": "",
"modified": "2023-07-19 12:21:19",
"status": "1",
"modifier": ""
}
},
{
"GitProject": {
"id": "1069995211000025073",
"workspace_id": "69995211",
"git_project_id": "11421734",
"git_app_id": "3",
"path_with_namespace": "orangecyang/mini_project_git",
"creator": "orangecyang",
"created": "2023-07-19 13:37:23",
"name": "",
"modified": "2023-07-19 13:37:24",
"status": "1",
"modifier": ""
}
}
],
"info": "success"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# 空间相关字段说明
# 空间相关重要字段说明
字段 | 说明 |
---|---|
workspace_id | 空间 id |
git_project_id | 代码仓库ID |
path_with_namespace | 代码仓库路径 |
creator | 关联关系创建者 |
created | 关联时间 |