| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- {
- "name": "category-tree",
- "displayName": "Amazon 类目树查询",
- "description": "获取 Amazon 类目层级树结构,用于定位目标品类的类目 ID,再通过 category_products 获取该类目下的产品列表。",
- "category": "voc",
- "version": "1.3.0",
- "endpoint": {
- "method": "POST",
- "url": "https://server.fmode.cn/api/voc-ecom/forward",
- "headers": {
- "Content-Type": "application/json",
- "Authorization": "Bearer {{vocToken}}"
- }
- },
- "parameters": {
- "type": "object",
- "properties": {
- "domain": {
- "type": "integer",
- "description": "Amazon 站点 ID: 1=amazon.com",
- "default": 1
- }
- }
- },
- "requestTransform": {
- "template": {
- "path": "/api/CategoryTree",
- "method": "POST",
- "query": {
- "domain": "{{domain}}"
- },
- "body": {}
- }
- },
- "response": {
- "type": "array",
- "description": "类目树节点数组",
- "items": {
- "type": "object",
- "properties": {
- "NodeId": {
- "type": "string",
- "description": "类目节点 ID"
- },
- "Name": {
- "type": "string",
- "description": "类目名称"
- },
- "Children": {
- "type": "array",
- "description": "子类目列表"
- }
- }
- }
- },
- "relatedSkills": [
- "category_products"
- ],
- "usageExamples": [
- {
- "name": "获取美国站类目树",
- "input": {
- "domain": 1
- },
- "description": "获取 amazon.com 的完整类目层级结构"
- }
- ],
- "reportMapping": {
- "slides": [
- "市场全景(Slide3)"
- ],
- "dataPoints": [
- "品类类目定位"
- ]
- },
- "timeout": 60000,
- "retry": {
- "maxAttempts": 3,
- "delay": 1000,
- "backoffMultiplier": 2
- },
- "tokenConfig": {
- "type": "bearer",
- "configFile": "~/.openclaw/voc-credentials.json",
- "tokenField": "vocToken",
- "currentToken": "r:858b3ee92314d5447d1fc3cdc10462d7",
- "resolutionOrder": [
- "configFile",
- "currentToken"
- ],
- "apigId": "Vo3ROWEvDy",
- "paymentUrlResolution": {
- "description": "动态构建充值URL:通过当前token查出用户objectId,拼接到充值页面",
- "steps": [
- "1. 从 voc-credentials.json 或 currentToken 获取当前 session token",
- "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId",
- "3. 拼接充值URL: https://pwa.fmode.cn/apig-pay.html?user={objectId}&apigid=Vo3ROWEvDy&fun_id=HOkkX72PMF",
- "4. 将该URL展示给用户,引导扫码支付"
- ],
- "userResolveEndpoint": "https://server.fmode.cn/parse/users/me",
- "userResolveHeaders": {
- "X-Parse-Application-Id": "ncloudmaster",
- "X-Parse-Session-Token": "{vocToken}"
- },
- "paymentBaseUrl": "https://pwa.fmode.cn/apig-pay.html",
- "paymentParams": {
- "user": "{resolvedUserId}",
- "apigid": "Vo3ROWEvDy",
- "fun_id": "HOkkX72PMF"
- },
- "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig"
- },
- "onMissing": {
- "action": "resolveUserThenShowPayment",
- "title": "扫码开通 VOC-AI 数据服务",
- "message": "此 Skill 需要有效的 API Token。请按以下步骤操作:\n1. 如果你已有 Token,请告诉我,我会保存到 ~/.openclaw/voc-credentials.json\n2. 如果没有 Token,我会引导你扫码充值开通"
- },
- "onBalanceInsufficient": {
- "action": "resolveUserThenShowPayment",
- "title": "VOC-AI Token 余额不足,请扫码充值",
- "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。"
- }
- },
- "errorHandling": {
- "balanceInsufficient": {
- "conditions": [
- {
- "responseField": "code",
- "operator": "in",
- "value": [
- -2,
- -3,
- -10,
- 402,
- 429
- ]
- },
- {
- "responseField": "msg",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance",
- "quota"
- ]
- },
- {
- "responseField": "message",
- "operator": "contains",
- "value": [
- "余额不足",
- "insufficient",
- "balance"
- ]
- }
- ],
- "matchMode": "any",
- "trigger": "tokenConfig.onBalanceInsufficient"
- },
- "unauthorized": {
- "conditions": [
- {
- "responseField": "code",
- "operator": "in",
- "value": [
- 401,
- 403
- ]
- },
- {
- "responseField": "msg",
- "operator": "contains",
- "value": [
- "unauthorized",
- "token",
- "invalid",
- "auth"
- ]
- }
- ],
- "matchMode": "any",
- "trigger": "tokenConfig.onMissing"
- }
- }
- }
|