获取 Worker 任务
方法: GET
端点: /api/v2/worker-tasks/{workerTaskId}
认证: 支持 Authorization: Bearer <YOUR_API_KEY>、api-key: <YOUR_API_KEY> 和 ?token=<YOUR_API_KEY>。推荐优先使用 Bearer token。
GET
/api/v2/worker-tasks/{workerTaskId}Get worker taskAuthenticationRequired
Stored only in this browser tab. Sent only to https://openapi.coreclaw.com.
Parameters
Required
Saved Worker task template slug. Get it from the `data.list[].slug` field of `GET /api/v2/worker-tasks`. The playground prefills a sample slug; replace it with your own.
Request BodyNot applicable
No JSON request body. Fill the path or query parameters above.
什么时候使用这个接口
Section titled “什么时候使用这个接口”用于读取某个已保存任务模板的详情。
workerTaskId是已保存任务模板的 slug。
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
workerTaskId | 是 | string | 已保存 Worker 任务模板的 slug,可从 GET /api/v2/worker-tasks 响应的 data.list[].slug 获取。 |
curl -X GET "https://openapi.coreclaw.com/api/v2/worker-tasks/YOUR_WORKER_TASK_ID" \ -H "Authorization: Bearer YOUR_API_KEY"{ "code": 0, "data": { "description": "Daily demo task", "id": 2001, "schedule_enabled": 1, "schedule_time": "09:30", "schedule_type": 1, "slug": "demo-task", "title": "Demo Task", "version": "latest", "worker_path": "owner~demo-worker", "worker_slug": "demo-worker" }, "message": "success", "request_id": "req-123"}- API v2 同时支持 Bearer token、旧版
api-key请求头和 query token;新集成建议优先使用 Bearer token。
HTTP 响应
Section titled “HTTP 响应”| HTTP 状态 | 应用代码 | 含义 |
|---|---|---|
200 | 0 | 请求成功。 |
400 | 11000 | 请求参数不合法。 |
401 | 12001 | 认证缺失或无效。 |
404 | 11004 | 目标资源不存在。 |
422 | 11000 | 请求语义或字段校验未通过。 |
429 | 13000 | 请求过于频繁。 |
500 | 10000 | 服务端内部错误。 |