GET /api/v1/forward/resources
返回当前调用方拥有的资源。可见资源会附带实时 resource_spec。
请求头
| Header | 是否必填 | 说明 |
|---|---|---|
| Authorization | 是 | Bearer <PAT> |
查询参数
| 参数 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| type | string | 是 | - | 资源类型:skill、file、vault 或 environment。 |
| limit | integer | 否 | 20 | 分页大小,最大 100。 |
| after_id | string | 否 | - | 资源 ID 游标,返回其后的记录,不能与 before_id 同用。 |
| before_id | string | 否 | - | 资源 ID 游标,返回其前的记录,不能与 after_id 同用。 |
示例请求
示例响应
HTTP 200 OK响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
| data | array | 当前页的 Resource 对象。 |
| has_more | boolean | 是否还有更多记录。 |
| first_id | string | null | 当前页第一条 Resource ID。 |
| last_id | string | null | 当前页最后一条 Resource ID。 |
Resource 对象字段
| 字段 | 类型 | 说明 |
|---|---|---|
| id | string | Resource ID,直接对齐资源 ID。 |
| type | string | 资源类型:skill、file、vault 或 environment。 |
| owner_type | string | 归属类型;本接口按 owner_type=user 过滤。 |
| owner_id | string | 当前调用方的资源拥有者 ID。 |
| resource_spec | object | 资源的扁平实时对象,字段集随 type 变化。 |
错误
| HTTP | Type | Code | 触发条件 |
|---|---|---|---|
| 400 | invalid_request_error | - | 缺少资源 type。 |
| 400 | invalid_request_error | - | 资源 type 不支持。 |
| 400 | invalid_request_error | - | limit 越界,或同时提供 after_id 和 before_id。 |
| 401 | authentication_error | authentication_required | PAT 无效或已过期。 |
注意事项
- 已失效或不可见的资源会被跳过,因此
data可能少于本地注册记录数。