文档

CreateRepositoryMember - 增加代码库成员

更新时间:

通过 OpenAPI 增加代码库成员,可支持多个用户添加。

服务接入点与授权信息

请求语法

POST https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/members

请求头

参数

类型

是否必填

描述

示例值

x-yunxiao-token

string

个人访问令牌。

pt-0fh3****0fbG_35af****0484

请求参数

参数

类型

位置

是否必填

描述

示例值

organizationId

string

path

组织 ID。

60de7a6852743a5162b5f957

repositoryId

string

path

代码库 ID 或者 URL-Encoder 编码的全路径。

2464454

accessLevel

integer

query

访问权限:20-浏览者,30-开发者,40-库管理员。

40

userId

string

query

云效用户 ID(支持多个成员 ID,按英文逗号隔开)。

62c795c9cf*****b468af8

expiresAt

string

query

到期时间,固定时间格式:yyyy-MM-dd。

2022-12-30

请求示例

curl -X 'POST' \
  'https://test.rdc.aliyuncs.com/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/members?accessLevel=<accessLevel>&userId=<userId>&expiresAt=<expiresAt>' \
  -H 'accept: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

返回参数

参数

类型

描述

示例值

-

object

accessLevel

integer

成员权限:20-浏览者,30-开发者,40-管理员。

40

avatarUrl

string

头像地址。

https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100

expiresAt

string

过期时间。

2022-12-30

id

integer

主键 ID(无实际业务意义)。

123456

name

string

成员名称。

test

state

string

状态:active-已激活, blocked-阻塞,暂无法使用。

active

userId

string

云效用户 ID(在 Codeup 提交的 OpenAPI 中涉及到用户 ID 之处,均应该使用该用户 ID)。

62c795c9cf*****b468af8

username

string

用户名称。

test_01

webUrl

string

页面访问 URL。

""

返回示例

{
    "accessLevel": 40,
    "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
    "expiresAt": "2022-12-30",
    "id": 0,
    "name": "test",
    "state": "active",
    "userId": "62c795c9cf*****b468af8",
    "username": "test_01",
    "webUrl": "\"\""
}

错误码

访问错误码中心查看 API 相关错误码。