资源:获取资源
路由 URL
GET https://playcanvas.com/api/assets/:assetId?branchId=:branchId
说明
获取单个资源的详细信息。
示例
curl -H "Authorization: Bearer {accessToken}" https://playcanvas.com/api/assets/{assetId}?branchId={branchId}
HTTP 请求
GET https://playcanvas.com/api/assets/{assetId}?branchId={branchId}
Authorization: Bearer {accessToken}
参数
| 名称 | 类型 | 必需 | 说明 |
|---|---|---|---|
assetId | number | ✔️ | 资源 ID。 |
branchId | string | ✔️ | 分支 ID。 |
响应结构
Status: 200
{
"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
}
错误
| 状态码 | 说明 |
|---|---|
| 401 | 未通过身份验证 |
| 403 | 禁止访问 |
| 404 | 未找到项目或资源 |
| 429 | 请求过多 |
请求限流
此路由采用普通限流。