# 说明

关联代码仓库与TAPD空间(无分页)

# url

https://api.tapd.cn/workspaces/set_relate_git_projects

# 支持格式

JSON/XML(默认JSON格式)

# HTTP请求方式

GET

# 请求数限制

一次返回所有符合条件的值 只能传代码仓库 git_project_id 参数,一次只能查一个仓库

# 请求参数

字段名 必选 类型及范围 默认 说明 特殊规则
git_project_id integer - 代码仓库ID
workspace_id integer - 空间ID
path_with_namespace integer - 代码仓库路径
clean_old_workspace integer 0 是否清空关联的其他空间及空间的webhook,enum(0, 1) , 0不清空, 1清空

# 调用示例及返回结果

# 将代码仓库ID为11421734关联到空间

# curl 使用 OAuth Access Token 鉴权调用示例

curl -H 'Authorization: Bearer ACCESS_TOKEN' 'https://api.tapd.cn/workspaces/set_relate_git_projects?git_project_id=11421734&workspace_id=69993176&path_with_namespace=orangecyang/mini_project_git'

# 返回结果

{
    "status": 1,
    "data": {
        "GitProject": {
            "id": "1069993260000025069",
            "workspace_id": "69993260",
            "git_project_id": "11421734",
            "path_with_namespace": "orangecyang/mini_project_git",
            "creator": "orangecyang",
            "created": "2023-07-19 12:21:19"
        }
    },
    "info": "success"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14

# 空间相关字段说明

# 空间相关重要字段说明

字段 说明
workspace_id 空间 id
git_project_id 代码仓库ID
path_with_namespace 代码仓库路径
creator 关联关系创建者
created 关联时间
上次更新: 2023-07-19 17:38:15