查询代码库分支的信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求语法
GET /repository/{repositoryId}/branches/detail
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
organizationId | string | 是 | 企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】 | 5fbe3118672533690be72b12 |
accessToken | string | 否 | 个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段 | f0b1e61db5961df5975a93f9129d2513 |
repositoryId | long | 是 | 代码库 ID | 2334743 |
branchName | string | 是 | 分支名称 | master |
返回参数
示例
正常返回示例
JSON
格式
{
"requestId": "6177543A-8D54-5736-A93B-E0195A1512CB",
"errorMessage": "\"\"",
"errorCode": "Openapi.RequestError",
"success": true,
"result": {
"name": "master",
"protected": "false",
"commit": {
"id": "e0297d8fb0393c833a8531e7cc8832739e3cba6d",
"shortId": "e0297d8f",
"title": "修改main.txt文件",
"authorName": "阿里云云效",
"authorEmail": "username@example.com",
"createdAt": "2022-03-18 10:00:00",
"message": "修改main.txt文件",
"authoredDate": "2022-03-18 08:00:00",
"committedDate": "2022-03-18 09:00:00",
"committerEmail": "username@example.com",
"committerName": "阿里云云效Committer",
"parentIds": [
"de02b625ba8488f92eb204bcb3773a40c1b4ddac"
],
"author": {
"id": 28056,
"name": "codeup-test",
"username": "testtest",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com"
},
"committer": {
"id": 5035,
"name": "codeup-commit",
"username": "commitcommit",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com"
},
"signature": {
"gpgKeyId": "\"\"",
"verificationStatus": "verified"
},
"commentsCount": 0
}
}
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
403 | Forbidden.AccessDenied | The user is not authorized to perform the operation. | 用户无权限执行相关操作 |
403 | Forbidden.UserNotInCurrentOrganization | The user is not in the organization and is not authorized to perform the operation. | 当前用户不在该企业中,无权进行操作。 |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|---|---|
2023-07-24 | OpenAPI 错误码发生变更、OpenAPI 返回结构发生变更 | 查看变更详情 |