api-config.json 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. {
  2. "name": "douyin-comment-replies",
  3. "displayName": "抖音评论回复查询",
  4. "description": "获取抖音指定视频中某条评论的全部回复,适用于深度舆情追踪、争议点分析、用户回复习惯研究。常配合 douyin-video-comments 使用。",
  5. "category": "douyin",
  6. "version": "1.3.0",
  7. "endpoint": {
  8. "method": "GET",
  9. "url": "https://server.fmode.cn/api/voc-social/douyin/app/v3/fetch_video_comment_replies",
  10. "headers": {
  11. "Authorization": "Bearer ${vocToken}",
  12. "Accept": "application/json"
  13. }
  14. },
  15. "parameters": {
  16. "type": "object",
  17. "required": [
  18. "item_id",
  19. "comment_id"
  20. ],
  21. "properties": {
  22. "item_id": {
  23. "type": "string",
  24. "description": "抖音作品 ID"
  25. },
  26. "comment_id": {
  27. "type": "string",
  28. "description": "评论 ID"
  29. },
  30. "cursor": {
  31. "type": "integer",
  32. "description": "分页游标,首次传 0",
  33. "default": 0
  34. },
  35. "count": {
  36. "type": "integer",
  37. "description": "每页数量,请保持默认 20",
  38. "default": 20
  39. }
  40. }
  41. },
  42. "requestTransform": {
  43. "queryParams": {
  44. "item_id": "{{item_id}}",
  45. "comment_id": "{{comment_id}}",
  46. "cursor": "{{cursor}}",
  47. "count": "{{count}}"
  48. }
  49. },
  50. "response": {
  51. "type": "object",
  52. "description": "评论回复列表",
  53. "properties": {
  54. "comments": {
  55. "type": "array",
  56. "description": "回复列表"
  57. },
  58. "has_more": {
  59. "type": "boolean",
  60. "description": "是否有更多回复"
  61. },
  62. "cursor": {
  63. "type": "integer",
  64. "description": "下一页游标"
  65. }
  66. }
  67. },
  68. "usageExamples": [
  69. {
  70. "name": "热评争议点深度分析",
  71. "input": {
  72. "item_id": "7354666303006723354",
  73. "comment_id": "7354669356632638218",
  74. "cursor": 0,
  75. "count": 20
  76. },
  77. "description": "获取高赞热评下的回复,分析用户争议点和进一步讨论的内容"
  78. }
  79. ],
  80. "workflow": {
  81. "description": "推荐调用链",
  82. "steps": [
  83. "上游: douyin-video-comments(aweme_id) → 获取评论列表 → 找到高赞热评(digg_count 最高)",
  84. "本步: douyin-comment-replies(item_id, comment_id) → 获取热评下的回复",
  85. "分析: 对回复内容做情感分类,发现用户争议点"
  86. ]
  87. },
  88. "reportMapping": {
  89. "slides": [
  90. "社媒聆听(Slide14)"
  91. ],
  92. "dataPoints": [
  93. "用户争议点内容",
  94. "热评下用户情感深度",
  95. "购买决策影响因素(对话式评论)"
  96. ]
  97. },
  98. "timeout": 60000,
  99. "retry": {
  100. "maxAttempts": 3,
  101. "delay": 1500,
  102. "backoffMultiplier": 2
  103. },
  104. "tokenConfig": {
  105. "type": "bearer",
  106. "configFile": "~/.openclaw/voc-credentials.json",
  107. "tokenField": "vocToken",
  108. "resolutionOrder": [
  109. "configFile"
  110. ],
  111. "apigId": "Vo3ROWEvDy",
  112. "paymentUrlResolution": {
  113. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  114. "steps": [
  115. "1. 从 voc-credentials.json 获取当前 session token",
  116. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  117. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  118. "4. 将该URL展示给用户,引导扫码支付"
  119. ],
  120. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  121. "userResolveHeaders": {
  122. "X-Parse-Application-Id": "ncloudmaster",
  123. "X-Parse-Session-Token": "{vocToken}"
  124. },
  125. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  126. "paymentParams": {
  127. "user": "{resolvedUserId}",
  128. "apigid": "Vo3ROWEvDy",
  129. "fun_id": "HOkkX72PMF"
  130. },
  131. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  132. },
  133. "onMissing": {
  134. "action": "showPaymentQR",
  135. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  136. "title": "扫码开通 VOC-AI 数据服务",
  137. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  138. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  139. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  140. },
  141. "onBalanceInsufficient": {
  142. "action": "resolveUserThenShowPayment",
  143. "title": "VOC-AI Token 余额不足,请扫码充值",
  144. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  145. }
  146. },
  147. "errorHandling": {
  148. "balanceInsufficient": {
  149. "conditions": [
  150. {
  151. "responseField": "code",
  152. "operator": "in",
  153. "value": [
  154. -2,
  155. -3,
  156. -10,
  157. 402,
  158. 429
  159. ]
  160. },
  161. {
  162. "responseField": "msg",
  163. "operator": "contains",
  164. "value": [
  165. "余额不足",
  166. "insufficient",
  167. "balance",
  168. "quota",
  169. "没有开通",
  170. "权限或余额"
  171. ]
  172. },
  173. {
  174. "responseField": "mess",
  175. "operator": "contains",
  176. "value": [
  177. "余额不足",
  178. "insufficient",
  179. "balance",
  180. "quota",
  181. "没有开通",
  182. "权限或余额"
  183. ]
  184. },
  185. {
  186. "responseField": "message",
  187. "operator": "contains",
  188. "value": [
  189. "余额不足",
  190. "insufficient",
  191. "balance",
  192. "没有开通",
  193. "权限或余额"
  194. ]
  195. }
  196. ],
  197. "matchMode": "any",
  198. "trigger": "tokenConfig.onBalanceInsufficient"
  199. },
  200. "unauthorized": {
  201. "conditions": [
  202. {
  203. "responseField": "code",
  204. "operator": "in",
  205. "value": [
  206. 401,
  207. 403
  208. ]
  209. },
  210. {
  211. "responseField": "msg",
  212. "operator": "contains",
  213. "value": [
  214. "unauthorized",
  215. "token",
  216. "invalid",
  217. "auth"
  218. ]
  219. }
  220. ],
  221. "matchMode": "any",
  222. "trigger": "tokenConfig.onMissing"
  223. }
  224. }
  225. }