资源:列出资源
路由 URL
GET https://playcanvas.com/api/projects/:projectId/assets?branchId=:branchId&skip=:skip&limit=:limit
说明
获取项目指定分支中全部资源的详细信息。
示例
curl -H "Authorization: Bearer {accessToken}" "https://playcanvas.com/api/projects/{projectId}/assets?branchId={branchId}&skip={number}&limit={number}"
HTTP 请求
GET https://playcanvas.com/api/projects/{projectId}/assets?branchId={branchId}&skip={number}&limit={number}
Authorization: Bearer {accessToken}
参数
| 名称 | 类型 | 必需 | 说明 |
|---|---|---|---|
projectId | number | ✔️ | 项目 ID。 |
branchId | string | ✔️ | 分支 ID。 |
skip | number | 列出前跳过的资源数量,用于分页,默认为 0。 | |
limit | number | 最多列出的资源数量,默认为 16,上限为 100000。 |
响应结构
Status: 200
{
"result": [{
"id": int,
"modifiedAt": date,
"createdAt": date,
"state": "ready" | "processing" | "error",
"name": string,
"type": string,
"scope":{
"type": string,
"id": int
},
"source": bool,
"sourceId": bool,
"tags": list of strings,
"preload": bool,
"file": {
"hash": string,
"filename": string,
"size": int,
"url": string
},
"parent": int
}, ...],
"pagination": {
"skip": int,
"limit": int,
"total": int,
}
}
错误
| 状态码 | 说明 |
|---|---|
| 401 | 未通过身份验证 |
| 403 | 禁止访问 |
| 404 | 未找到项目 |
| 429 | 请求过多 |
请求限流
此路由采用普通限流。