Skip to main content
GET
列出代码扫描

权限

需要具有组织级 ViewCodeScans 权限的服务用户个人访问令牌

行为

返回该组织的代码扫描,按最新优先排序。可使用此接口轮询通过启动代码扫描启动的扫描的 statuswaitingpendingrunningcompleted (或 failed / cancelled) 。awaiting_user_input 仅适用于从 Web 应用发起的交互式扫描;通过 API 发起的扫描不会进入该状态。要列出某个 Enterprise 中所有组织的扫描,请使用列出代码扫描 (Enterprise)

过滤器

  • time_after / time_before:以秒为单位的 Unix 时间戳 (UTC) ,用于限定扫描的创建时间。
  • repo_name:仅返回扫描过此代码仓库的记录。也会匹配包含该代码仓库的多代码仓库扫描。
结果使用不透明游标 (after / first) 进行分页。

授权

Authorization
string
header
必填

服务用户凭据(前缀:cog_)

路径参数

org_id
string
必填

Organization ID(前缀:org-)

示例:

"org-abc123def456"

查询参数

time_before
integer | null
time_after
integer | null
after
string | null
first
integer
默认值:100
必填范围: 1 <= x <= 200
repo_name
string | null

筛选扫描过此代码仓库的扫描。即使该代码仓库不是扫描的主代码仓库,也会匹配多代码仓库扫描,因此返回项中的 repo_name 可能不同。

响应

成功响应

items
CodeScanResponse · object[]
必填
end_cursor
string | null

用于获取下一页的游标;如果这是最后一页,则为 None。

has_next_page
boolean
默认值:false

此页之后是否还有更多项。

total
integer | null

可选的总数(为提升性能可省略)。