api-config.json 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. {
  2. "name": "quickly-video-query",
  3. "displayName": "一键成片 - 查询生成结果",
  4. "description": "通过 Parse 云函数查询 Quickly 一键成片任务的视频生成结果。用于轮询等待 AI 视频生成完成,返回视频URL/封面URL/时长列表。",
  5. "category": "video-creation",
  6. "version": "1.0.0",
  7. "endpoint": {
  8. "method": "POST",
  9. "url": "https://server.fmode.cn/api/functions",
  10. "headers": {
  11. "Content-Type": "application/json"
  12. }
  13. },
  14. "parameters": {
  15. "type": "object",
  16. "required": ["taskId"],
  17. "properties": {
  18. "taskId": {
  19. "type": "string",
  20. "description": "quickly-video-create 返回的 task_id,用于查询对应任务的视频生成结果"
  21. }
  22. }
  23. },
  24. "requestTransform": {
  25. "description": "通过 Parse 云函数查询,固定传入云函数ID和action",
  26. "body": {
  27. "id": "sWvRr8RvPT",
  28. "_ApplicationId": "ncloudmaster",
  29. "action": "query",
  30. "taskId": "{{taskId}}"
  31. }
  32. },
  33. "response": {
  34. "type": "object",
  35. "description": "视频生成结果",
  36. "properties": {
  37. "code": {
  38. "type": "integer",
  39. "description": "200 = 成功"
  40. },
  41. "success": {
  42. "type": "boolean",
  43. "description": "true = 数据有效"
  44. },
  45. "data": {
  46. "type": "array",
  47. "description": "视频结果列表,生成中时为空数组",
  48. "items": {
  49. "type": "object",
  50. "properties": {
  51. "objectId": {
  52. "type": "string",
  53. "description": "视频记录唯一ID(用于 recordDownload 接口)"
  54. },
  55. "taskId": {
  56. "type": "string",
  57. "description": "对应的任务ID"
  58. },
  59. "preId": {
  60. "type": "string",
  61. "description": "预定视频ID(对应创建任务时传入的 pre_id)"
  62. },
  63. "coverUrl": {
  64. "type": "string",
  65. "description": "视频封面图URL"
  66. },
  67. "videoUrl": {
  68. "type": "string",
  69. "description": "视频播放/下载URL(mp4格式)"
  70. },
  71. "videoName": {
  72. "type": "string",
  73. "description": "视频名称"
  74. },
  75. "videoDuration": {
  76. "type": "number",
  77. "description": "视频时长(秒)"
  78. },
  79. "status": {
  80. "type": "string",
  81. "description": "始终为 success(云函数 query 只返回 status='success' 的记录)"
  82. },
  83. "createdAt": {
  84. "type": "string",
  85. "description": "视频生成时间(ISO 8601)"
  86. }
  87. }
  88. }
  89. }
  90. }
  91. },
  92. "pollingConfig": {
  93. "interval": 15000,
  94. "maxAttempts": 40,
  95. "successCondition": "data.length > 0",
  96. "stillPendingCondition": "data.length === 0 (cloud function only returns status='success' records; empty = still processing or failed)",
  97. "timeoutAction": "轮询超时40次仍无结果,通常表示生成失败(素材URL不可达、格式不支持、Quickly 服务异常等)"
  98. },
  99. "usageExamples": [
  100. {
  101. "name": "查询视频生成结果",
  102. "input": {
  103. "taskId": "987654321"
  104. },
  105. "description": "轮询查询任务 987654321 的视频生成结果",
  106. "expectedOutput": {
  107. "code": 200,
  108. "success": true,
  109. "data": [
  110. {
  111. "objectId": "abc123",
  112. "taskId": "987654321",
  113. "preId": "1711234567890",
  114. "coverUrl": "https://cdn.kuaizi.co/covers/xxx.jpg",
  115. "videoUrl": "https://cdn.kuaizi.co/videos/xxx.mp4",
  116. "videoName": "推拉门_极简风格",
  117. "videoDuration": 15,
  118. "status": "success"
  119. }
  120. ]
  121. }
  122. }
  123. ],
  124. "timeout": 15000,
  125. "retry": {
  126. "maxAttempts": 1,
  127. "delay": 0
  128. }
  129. }