分支:列出分支
路由 URL
GET https://playcanvas.com/api/projects/:projectId/branches
说明
获取项目全部未关闭分支的列表。
示例
curl -H "Authorization: Bearer {accessToken}" "https://playcanvas.com/api/projects/{projectId}/branches"
HTTP 请求
GET https://playcanvas.com/api/projects/{projectId}/branches
Authorization: Bearer {accessToken}
参数
| 名称 | 类型 | 说明 |
|---|---|---|
projectId | number | 项目 ID。 |
响应结构
Status: 200
{
"result": [ {
"id": string,
"projectId": int,
"name": "Branch Name",
"createdAt": date,
"closed": bool,
"latestCheckpointId": string,
"user": {
"id": int,
"fullName": string,
"username": string
}
},, ...],
"pagination": {
"hasMore": bool
}
}
此接口使用略有不同的分页方式。响应包含 hasMore: true 时表示还有结果。将最后收到的分支 ID 作为 ?skip=branchId 查询参数,可继续按字母顺序获取分支。
错误
| 状态码 | 说明 |
|---|---|
| 401 | 未通过身份验证 |
| 403 | 禁止访问 |
| 404 | 未找到项目 |
| 429 | 请求过多 |
请求限流
此路由采用普通限流。