获取任务详情
POST
https://ts-api.fyshark.com/api/sutui/tasks/info
接口描述
获取单个任务的详细信息,包括任务状态、输入输出参数、用户信息等。
请求头
Content-Type: application/json
Authorization: Bearer {token}
请求参数
| 参数名 | 类型 | 必填 | 描述 | 示例 |
|---|---|---|---|---|
| task_id | string | 是 | 系统任务ID | "uuid-string" |
请求示例
{
"task_id": "123e4567-e89b-12d3-a456-426614174000"
}
响应格式
成功响应 200:
{
"code": 200,
"message": "获取成功",
"data": {
"id": 123,
"user_id": 456,
"task_id": "uuid-string",
"online_task_id": "fal-request-id",
"app_name": "st-ai/fast-sdxl",
"api_key": "key-string",
"task_type": "fal",
"status": "completed",
"input_params": {
"prompt": "a beautiful landscape painting",
"seed": 42,
"image_size": "landscape_4_3",
"num_inference_steps": 25,
"guidance_scale": 7.5
},
"output_params": {
"images": [
{
"url": "https://example.com/image.jpg",
"width": 1024,
"height": 768,
"content_type": "image/jpeg"
}
],
"timings": {
"inference": 2.5
},
"seed": 42
},
"money": 0.1,
"created_at": "2024-01-01T12:00:00",
"updated_at": "2024-01-01T12:05:00",
"name": "用户名称",
"head_img": "https://example.com/avatar.jpg",
"is_liked": false
}
}
错误响应:
// 404 任务不存在
{
"code": 404,
"message": "任务不存在"
}
// 401 未授权
{
"code": 401,
"message": "Token invalid, please check out"
}
// 500 服务器错误
{
"code": 500,
"message": "获取Fal任务信息失败: error details"
}
📊 返回字段说明
| 字段名 | 类型 | 描述 |
|---|---|---|
| id | integer | 数据库中的主键 ID |
| user_id | integer | 用户 ID |
| task_id | string | 系统生成的任务 UUID |
| online_task_id | string | 第三方服务(如 Fal)的任务 ID |
| app_name | string | 应用名称 |
| task_type | string | 任务类型(fal, veo3_api 等) |
| status | string | 任务状态(pending, running, completed, failed) |
| input_params | object | 任务输入参数 |
| output_params | object | 任务输出结果 |
| money | number | 任务消耗的费用 |
| name | string | 用户名称 |
| head_img | string | 用户头像 URL |
| is_liked | boolean | 是否已点赞 |
💡 特殊说明
- 该接口会同步任务状态并返回最新信息
- 对于正在运行的任务,可能需要等待几秒才能获取最新的状态
input_params和output_params已经解析为 JSON 对象- 任务详情会额外返回用户信息(姓名、头像)和点赞状态
- 只能查询当前用户的任务,无法查询其他用户的任务