异步任务
异步任务模式(202 Accepted + 轮询)。状态根据经过的时间计算,没有后台 worker:queued(前 2 秒)-> running(进度 0-99%)-> completed | failed("fail" 任务在 60% 时失败)| cancelled。存储在内存中,最多 200 个任务(最旧的非初始任务会被淘汰),重启后清空。
你的账号已解锁这些端点。在每个端点的页面上用 Try it 发送请求。
- GET
https://api.testingapis.com/api/jobsList all jobs, newest firstList all jobs, newest first. - POST
https://api.testingapis.com/api/jobsStart an asynchronous jobStart an asynchronous job. - GET
https://api.testingapis.com/api/jobs/{id}Get a job's current status and progressGet a job's current status and progress. - DELETE
https://api.testingapis.com/api/jobs/{id}Cancel a queued or running jobCancel a queued or running job. - GET
https://api.testingapis.com/api/jobs/{id}/resultGet the result of a completed jobGet the result of a completed job.
请求示例
List all jobs, newest first. 完整参考和 Send 按钮(英文).
cURL
curl -X GET "https://api.testingapis.com/api/jobs"响应 · 200 OK
[
{
"id": "job_1001",
"type": "import",
"status": "running",
"progress": 8,
"durationSeconds": 60,
"createdAt": "2026-09-30T18:26:35Z",
"startedAt": "2026-09-30T18:26:37Z",
"finishedAt": null,
"statusUrl": "/api/jobs/job_1001",
"resultUrl": null,
"error": null
},
… (15 more lines)