查询代码库某个文件的具体内容。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求语法
GET /repository/{repositoryId}/files/blobs
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
|---|---|---|---|---|
| organizationId | string | 是 | 企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】 | 60de7a6852743a5162b5f957 | 
| accessToken | string | 否 | 个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段 | f0b1e61db5961df5975a93f9129d2513 | 
| repositoryId | long | 是 | 代码库 ID | 2744800 | 
| filePath | string | 是 | 文件路径 | src/Test.java | 
| ref | string | 是 | 分支名称、标签名称或者提交的版本号 | master / tag1.0 / ecykhdd | 
| from | long | 否 | 文件开始行,若为空,则取文件全部内容 | 10 | 
| to | long | 否 | 文件结束行,且只有在 from 不为空时才有意义 | 10 | 
返回参数
示例
正常返回示例
JSON格式
{
  "requestId": "F590C9D8-E908-5B6C-95AC-56B7E8011FFA",
  "errorMessage": "”“",
  "errorCode": "SYSTEM_UNKNOWN_ERROR",
  "success": true,
  "result": {
    "content": "xxxx",
    "totalLines": 65535,
    "size": 10
  }
}错误码
| HTTP status code | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 403 | Forbidden.UserNotAdminOrOwner | The current user is not an admin or owner in the organization and 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-10-24 | OpenAPI 错误码发生变更、OpenAPI 返回结构发生变更 | 查看变更详情 | 
