api-config.json 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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": "评论回复数据(双层包装:{code, data},回复在 data 内)",
  53. "note": "顶层 {code:200, data:{...}},回复列表、翻页均在 data 内。",
  54. "properties": {
  55. "code": {
  56. "type": "integer",
  57. "description": "HTTP 状态码(200=成功)"
  58. },
  59. "data": {
  60. "type": "object",
  61. "description": "业务数据包装层",
  62. "properties": {
  63. "comments": {
  64. "type": "array",
  65. "description": "回复列表,每项含 text(回复正文)、user(回复者)、digg_count(点赞)、create_time 等"
  66. },
  67. "has_more": {
  68. "type": "integer",
  69. "description": "是否有更多回复(1=有,0=无)"
  70. },
  71. "cursor": {
  72. "type": "integer",
  73. "description": "下一页游标"
  74. }
  75. }
  76. }
  77. },
  78. "keyFields": {
  79. "data.comments[].text": "回复正文",
  80. "data.comments[].user.nickname": "回复者昵称",
  81. "data.comments[].digg_count": "回复获赞数",
  82. "data.has_more": "翻页终止条件",
  83. "data.cursor": "下一页游标"
  84. }
  85. },
  86. "usageExamples": [
  87. {
  88. "name": "热评争议点深度分析",
  89. "input": {
  90. "item_id": "7354666303006723354",
  91. "comment_id": "7354669356632638218",
  92. "cursor": 0,
  93. "count": 20
  94. },
  95. "description": "获取高赞热评下的回复,分析用户争议点和进一步讨论的内容"
  96. }
  97. ],
  98. "workflow": {
  99. "description": "推荐调用链",
  100. "steps": [
  101. "上游: douyin-video-comments(aweme_id) → 获取评论列表 → 找到高赞热评(digg_count 最高)",
  102. "本步: douyin-comment-replies(item_id, comment_id) → 获取热评下的回复",
  103. "分析: 对回复内容做情感分类,发现用户争议点"
  104. ]
  105. },
  106. "reportMapping": {
  107. "slides": [
  108. "社媒聆听(Slide14)"
  109. ],
  110. "dataPoints": [
  111. "用户争议点内容",
  112. "热评下用户情感深度",
  113. "购买决策影响因素(对话式评论)"
  114. ]
  115. },
  116. "timeout": 60000,
  117. "retry": {
  118. "maxAttempts": 3,
  119. "delay": 1500,
  120. "backoffMultiplier": 2
  121. },
  122. "tokenConfig": {
  123. "type": "bearer",
  124. "configFile": "~/.openclaw/voc-credentials.json",
  125. "tokenField": "vocToken",
  126. "resolutionOrder": [
  127. "configFile"
  128. ],
  129. "apigId": "Vo3ROWEvDy",
  130. "paymentUrlResolution": {
  131. "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面",
  132. "steps": [
  133. "1. 从 voc-credentials.json 获取当前 session token",
  134. "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
  135. "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  136. "4. 将该URL展示给用户,引导扫码支付"
  137. ],
  138. "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
  139. "userResolveHeaders": {
  140. "X-Parse-Application-Id": "ncloudmaster",
  141. "X-Parse-Session-Token": "{vocToken}"
  142. },
  143. "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/",
  144. "paymentParams": {
  145. "user": "{resolvedUserId}",
  146. "apigid": "Vo3ROWEvDy",
  147. "fun_id": "HOkkX72PMF"
  148. },
  149. "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
  150. },
  151. "onMissing": {
  152. "action": "showPaymentQR",
  153. "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
  154. "title": "扫码开通 VOC-AI 数据服务",
  155. "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。",
  156. "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}",
  157. "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js <session-token> 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。"
  158. },
  159. "onBalanceInsufficient": {
  160. "action": "resolveUserThenShowPayment",
  161. "title": "VOC-AI Token 余额不足,请扫码充值",
  162. "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
  163. }
  164. },
  165. "errorHandling": {
  166. "balanceInsufficient": {
  167. "conditions": [
  168. {
  169. "responseField": "code",
  170. "operator": "in",
  171. "value": [
  172. -2,
  173. -3,
  174. -10,
  175. 402,
  176. 429
  177. ]
  178. },
  179. {
  180. "responseField": "msg",
  181. "operator": "contains",
  182. "value": [
  183. "余额不足",
  184. "insufficient",
  185. "balance",
  186. "quota",
  187. "没有开通",
  188. "权限或余额"
  189. ]
  190. },
  191. {
  192. "responseField": "mess",
  193. "operator": "contains",
  194. "value": [
  195. "余额不足",
  196. "insufficient",
  197. "balance",
  198. "quota",
  199. "没有开通",
  200. "权限或余额"
  201. ]
  202. },
  203. {
  204. "responseField": "message",
  205. "operator": "contains",
  206. "value": [
  207. "余额不足",
  208. "insufficient",
  209. "balance",
  210. "没有开通",
  211. "权限或余额"
  212. ]
  213. }
  214. ],
  215. "matchMode": "any",
  216. "trigger": "tokenConfig.onBalanceInsufficient"
  217. },
  218. "unauthorized": {
  219. "conditions": [
  220. {
  221. "responseField": "code",
  222. "operator": "in",
  223. "value": [
  224. 401,
  225. 403
  226. ]
  227. },
  228. {
  229. "responseField": "msg",
  230. "operator": "contains",
  231. "value": [
  232. "unauthorized",
  233. "token",
  234. "invalid",
  235. "auth"
  236. ]
  237. }
  238. ],
  239. "matchMode": "any",
  240. "trigger": "tokenConfig.onMissing"
  241. }
  242. }
  243. }