Install any skill in seconds. Free to start, no credit card required.
Get Started Free →CloudCC OpenAPI 调用技能 - 提供完整的 REST API 接口调用能力,支持对象/字段元数据查询
.claude/skills/leoyeai-cloudcc-openapi-withobject/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 201% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 203% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 145% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 339% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 413% | 0% |
| 参数 | 说明 | 默认值 | 必填 | |------|------|--------|------| | orgId | 组织 ID | - | 是 | | username | 登录用户名 | - | 是 | | safetyMark | 安全标记(邮箱获取) | - | 是 | | clientId | 连接应用的 clientId | - | 是 | | secretKey | 连接应用的 secretKey | - | 是 | | apiDomain | API 网关地址(动态获取) | - | 否(自动获取) |
bash# 1. 创建技能目录 mkdir -p ~/.openclaw/skills/cloudcc-openapi-withobject # 2. 创建配置文件 cat > ~/.openclaw/skills/cloudcc-openapi-withobject/config.json << 'EOF' { "orgId": "your-org-id", "username": "your-username", "safetyMark": "your-safety-mark", "clientId": "your-client-id", "secretKey": "your-secret-key" } EOF
| 方法 | 说明 | API 端点 | |------|------|---------| | getAllTabs | 获取所有选项卡(推荐用于查找对象) | /openApi/common (getAllTabs) | | pageQuery | 查询对象数据(不带 fields 返回所有字段) | /openApi/common (pageQuery) | | getStandardObjects | 获取标准对象列表 | /api/customObject/standardObjList | | getCustomObjects | 获取自定义对象列表 | /api/customObject/list | | getObjectFields | 获取对象字段列表 | /api/fieldSetup/queryField |
> 注意: 元数据查询 API (/api/customObject/* 和 /api/fieldSetup/*) 可能需要额外的权限或使用 Setup 服务域名。推荐使用 getAllTabs 方法查找对象 API 名称。
bash# 1. 获取 API 网关地址 curl -X GET "https://developer.apis.cloudcc.cn/oauth/apidomain?scope=cloudccCRM&orgId=YOUR_ORG_ID" # 返回示例: # {"result":true,"returnInfo":"","returnCode":"1","orgapi_address":"https://xxxx.apis.cloudcc.cn/lightningapi"} # 2. 获取 accessToken curl -X POST "https://xxxx.apis.cloudcc.cn/lightningapi/api/cauth/token" \ -H "Content-Type: application/json" \ -d '{ "username":"your-username", "safetyMark":"your-safety-mark", "clientId":"your-client-id", "secretKey":"your-secret-key", "orgId":"your-org-id", "grant_type":"password" }' # 返回示例: # {"data":{"accessToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."},"returnCode":"1","result":true}
bash# 查看最近的日志 ~/.openclaw/skills/cloudcc-openapi-withobject/scripts/logger.sh view 50 # 查看统计信息 ~/.openclaw/skills/cloudcc-openapi-withobject/scripts/logger.sh stats 3 # 搜索日志 ~/.openclaw/skills/cloudcc-openapi-withobject/scripts/logger.sh search "productuplist" # 导出日志 ~/.openclaw/skills/cloudcc-openapi-withobject/scripts/logger.sh export # 清理旧日志(保留最近 3 天) ~/.openclaw/skills/cloudcc-openapi-withobject/scripts/logger.sh cleanup 3
每条日志为 JSON 格式,包含以下字段:
json{ "timestamp": "2026-03-20 12:15:30", "type": "API_REQUEST", "service": "pageQuery", "objectApi": "productuplist", "responseCode": "1", "durationMs": "125" }
| 类型 | 说明 | 示例 | |------|------|------| | API_REQUEST | API 调用记录 | 记录所有 OpenAPI 调用 | | AUTH_EVENT | 认证事件 | token 请求、刷新、过期 |
bashcurl -X POST "$API_DOMAIN/api/customObject/standardObjList" \ -H "accessToken: $TOKEN" \ -H "Content-Type: application/json" \ -d '{}'
返回示例:
json{ "result": true, "data": [ {"id": "account", "objname": "客户", "label": "Account", "objprefix": "001"}, {"id": "contact", "objname": "联系人", "label": "Contact", "objprefix": "003"}, {"id": "opportunity", "objname": "业务机会", "label": "Opportunity", "objprefix": "002"} ] }
bashcurl -X POST "$API_DOMAIN/api/customObject/list" \ -H "accessToken: $TOKEN" \ -H "Content-Type: application/json" \ -d '{"id":""}'
返回示例:
json{ "result": true, "data": { "objList": [ {"id": "2021A51AA0D3785lBzwh", "objLabel": "产品需求研发报备记录", "schemetable_name": "productuplist", "prefix": "b70"}, {"id": "2023D181015EDF0f7G1y", "objLabel": "需求池", "schemetable_name": "requirementpool", "prefix": "c75"} ] } }
bashcurl -X POST "$API_DOMAIN/api/fieldSetup/queryField" \ -H "accessToken: $TOKEN" \ -H "Content-Type: application/json" \ -d '{"prefix":"b70"}'
返回示例:
json{ "result": true, "data": { "obj": {"id": "2021A51AA0D3785lBzwh", "label": "产品需求研发报备记录"}, "stdFields": [ {"id": "1", "labelName": "名称", "schemefieldName": "name", "schemefieldType": "S"} ], "cusFields": [ {"id": "c1", "labelName": "产品", "schemefieldName": "product", "schemefieldType": "S"}, {"id": "c2", "labelName": "状态", "schemefieldName": "zhuangtai", "schemefieldType": "L"} ] } }
bash# 搜索包含关键词的选项卡 curl -X POST "$API_DOMAIN/openApi/common" \ -H "accessToken: $TOKEN" \ -H "Content-Type: application/json" \ -d '{"serviceName":"getAllTabs"}' | jq '.data[] | select(.tab_name | test("产品 | 需求"))'
返回示例:
json{ "tab_name": "产品需求研发报备记录", "objectApi": "productuplist", "prefix": "b70", "objId": "2021A51AA0D3785lBzwh" }
json{ "serviceName": "cquery", "objectApiName": "Contact", "expressions": "name='test'", "isAddDelete": "false", "fields": "name,createdate,createbyid" }
json{ "serviceName": "pageQuery", "objectApiName": "Account", "fields": "id,name,phone", "expressions": "industry='Technology'", "pageNUM": 1, "pageSize": 20 }
json{ "serviceName": "insert", "objectApiName": "Contact", "data": "[{\"name\":\"张三\",\"phone\":\"13800138000\",\"email\":\"zhangsan@example.com\"}]" }
json{ "serviceName": "update", "objectApiName": "Contact", "data": "[{\"id\":\"003202100BDF459HcI1R\",\"name\":\"李四\",\"phone\":\"13900139000\"}]" }
json{ "serviceName": "delete", "objectApiName": "Contact", "data": "[{\"id\":\"003202100BDF459HcI1R\"}]" }
json{ "serviceName": "upsert", "objectApiName": "Contact", "data": "[{\"id\":\"003202100BDF459HcI1R\",\"name\":\"王五\"}]" }
| 接口 | 服务名 | 说明 | |------|--------|------| | 获取网关 | GET /oauth/apidomain | 动态获取组织 API 地址 | | 获取 token | POST /api/cauth/token | 获取 accessToken | | 验证 token | isValidWithBinding | 验证 accessToken 有效性 |
| 接口 | 端点 | 说明 | |------|------|------| | 获取标准对象 | POST /api/customObject/standardObjList | 返回所有标准对象 | | 获取自定义对象 | POST /api/customObject/list | 返回所有自定义对象 | | 获取对象字段 | POST /api/fieldSetup/queryField | 根据 prefix 查询字段 | | 获取选项卡 | POST /openApi/common (getAllTabs) | 返回所有选项卡配置 |
| 接口 | 服务名 | 说明 | |------|--------|------| | 普通查询 | cquery | 基础查询 | | 带权限查询 | cqueryWithRoleRight | 含权限控制的查询 | | 分页查询 | pageQuery | 分页数据查询 | | 分页带权限查询 | pageQueryWithRoleRight | 含权限的分页查询 | | 获取查询权限 | getQueryPermisson | 获取对象查询权限 | | SQL 查询 | cqlQueryWithLogInfo | 自定义 SQL 查询 | | 静态查询 | cqlQueryWithStatic | 支持游标的静态查询 |
| 接口 | 服务名 | 说明 | |------|--------|------| | 插入 | insert | 插入数据 | | 带权限插入 | insertWithRoleRight | 含权限控制的插入 | | 更新 | update | 更新数据 | | 带权限更新 | updateWithRoleRight | 含权限控制的更新 | | 删除 | delete | 删除数据 | | 带权限删除 | deleteWithRoleRight | 含权限控制的删除 | | Upsert | upsert | 插入或更新 | | Upsert 带权限 | upsertWithRoleRight | 含权限的 upsert |
| 接口 | 服务名 | 地址 | 说明 | |------|--------|------|------| | 上传图片 | uploadImg | /openApi/file | 单张图片上传 | | 上传多图 | uploadImgMany | /openApi/file | 最多 9 张 | | 获取图片属性 | getImgProperty | /openApi/common | 查询图片信息 | | 上传文件 | uploadFile | /openApi/file | 文件流上传 | | 上传附件 | uploadAttachement | /openApi/common | base64 上传 | | 下载文件 | downloadFile | /openApi/downloadFile | GET 请求 | | 下载附件 | downloadAttachement | /openApi/common | base64 下载 | | 删除附件 | deleteAttachment | /openApi/common | 删除附件 | | 删除文件 | deleteFile | /openApi/common | 删除文件 |
| 接口 | 服务名 | 说明 | |------|--------|------| | 发送邮件 | sendEmail | 支持模板变量 | | 发送短信 | telMessage | 手机消息服务 |
| 接口 | 服务名 | 说明 | |------|--------|------| | 获取 Chatter | getChatters01 | 查询微帖内容 | | 获取我的 Chatter | getMyChatter01 | 我追随的内容 | | 获取追随者 | getFollowUsers | 查询追随关系 | | 发布帖子 | addMicroPostF | 普通帖子 | | 发布文件帖 | addMicroPostD | 带文件的帖子 | | 发布链接帖 | addMicroPostL | 带链接的帖子 | | 发布投票帖 | addMicroPostV | 投票类型帖子 | | 投票 | voteMicroPost | 对帖子投票 | | 发布评论 | addMicroComment | 普通评论 | | 文件评论 | addMicroCommentFile | 带文件评论 | | 点赞帖子 | praiseFeed | 喜欢/取消喜欢 | | 点赞评论 | praiseComment | 评论点赞 | | 收藏帖子 | favoriteFeed | 收藏/取消收藏 | | 删除帖子 | removeMicroPost | 删除微帖 | | 删除评论 | removeMicroComment | 删除评论 | | 追随操作 | operateFollowRelation | 追随/取消追随 |
| 接口 | 服务名 | 说明 | |------|--------|------| | 待审批列表 | getApprovalPaddingList | 查询待审批项目 | | 批准 | doApproved | 批准操作 | | 拒绝 | doRejected | 拒绝操作 | | 重新分配 | doReassign | 重新分配审批人 | | 调回 | reCall | 调回审批 | | 提交审批 | submitForApproval | 提交审批流程 |
| 接口 | 服务名 | 说明 | |------|--------|------| | 获取应用列表 | getAppList | 应用程序列表 | | 获取选项卡 | getAllTabs | 选项卡信息 | | 获取应用和选项卡 | getAppAndTabList | 合并查询 | | 获取搜索设置 | getMySetupObjs | 搜索配置 | | 获取选项列表值 | getPickListValue | 字段选项值 | | 保存依赖关系 | saveDependency | 选项依赖配置 | | 自助服务 | customService | MongoDB 数据操作 |
| 代码 | 说明 | |------|------| | 1 | 调用成功 | | -1 | 调用成功但接口异常 | | -2 | 调用不成功(如失效) | | -3 | 参数输入有误 |
bash# 步骤 1: 通过选项卡名称查找对象(最直观) curl -X POST "$API_DOMAIN/openApi/common" \ -H "accessToken: $TOKEN" \ -H "Content-Type: application/json" \ -d '{"serviceName":"getAllTabs"}' | jq '.data[] | select(.tab_name | test("产品需求"))' # 返回:{"objectApi":"productuplist","prefix":"b70","objId":"2021A51AA0D3785lBzwh"} # 步骤 2: 使用 objectApi 查询数据 curl -X POST "$API_DOMAIN/openApi/common" \ -H "accessToken: $TOKEN" \ -H "Content-Type: application/json" \ -d '{"serviceName":"pageQuery","objectApiName":"productuplist","pageNUM":1,"pageSize":20}' # 步骤 3: 使用 prefix 查询字段结构 curl -X POST "$API_DOMAIN/api/fieldSetup/queryField" \ -H "accessToken: $TOKEN" \ -H "Content-Type: application/json" \ -d '{"prefix":"b70"}'
禁止写死 API 地址,组织网关可能根据负载漂移:
bash# 每次启动时获取 API_DOMAIN=$(curl -s "https://developer.apis.cloudcc.cn/oauth/apidomain?scope=cloudccCRM&orgId=$ORG_ID" | jq -r '.orgapi_address')
accessToken: <value>isValidWithBinding)[{...}, {...}]URL 中的特殊字符需要 URL 编码:
javajava.net.URLEncoder.encode("%", "UTF-8")
| 版本 | 基础次数 | 每用户额外 | 最大限额/24h | |------|---------|-----------|-------------| | 专业版 | 5000 | 用户数×150 | 10000 | | 企业版 | 50000 | 用户数×300 | 200000 | | 旗舰版 | 50000 | 用户数×500 | 500000 | | 超级版 | 50000 | 用户数×500 | 500000 |
> ⚠️ 禁止超负荷请求,否则 API Client 可能被停用
/api/cauth/token/oauth/apidomaingetAllTabs 或 getCustomObjects 确认对象 API 名称bash# 1. 验证 token 有效性 curl -X POST "$API_DOMAIN/openApi/common" \ -H "accessToken: $TOKEN" \ -H "Content-Type: application/json" \ -d '{"serviceName":"isValidWithBinding"}' # 2. 检查返回码 # returnCode: "1" 表示成功 # returnCode: "-1" 表示接口异常 # returnCode: "-2" 表示 token 失效 # returnCode: "-3" 表示参数错误 # 3. 查找对象 API 名称 curl -X POST "$API_DOMAIN/openApi/common" \ -H "accessToken: $TOKEN" \ -H "Content-Type: application/json" \ -d '{"serviceName":"getAllTabs"}' | jq '.data[] | select(.tab_name | test("关键词"))'
logger.sh - 日志管理工具getStandardObjects - 获取标准对象列表getCustomObjects - 获取自定义对象列表getObjectFields - 获取对象字段列表getAllTabs - 获取选项卡信息维护人: 鲁班 参考文档: https://help.cloudcc.cn/product03/apigai-lan/
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 13,876 | 8,668 | -38% | 1 | 1 | 0% | 2,405 | 7,240 | +201% | 0 | 0 | — |
case-02 | fail→pass | 10,415 | 3,096 | -70% | 1 | 1 | 0% | 2,021 | 6,116 | +203% | 0 | 0 | — |
case-03 | fail→pass | 19,531 | 13,643 | -30% | 1 | 1 | 0% | 3,383 | 8,305 | +145% | 0 | 0 | — |
case-04 | pass→pass | 13,634 | 11,752 | -14% | 1 | 1 | 0% | 2,581 | 7,708 | +199% | 0 | 0 | — |
case-05 | pass→pass | 11,138 | 11,215 | +1% | 1 | 1 | 0% | 1,976 | 7,236 | +266% | 0 | 0 | — |
case-06 | pass→pass | 8,176 | 7,751 | -5% | 1 | 1 | 0% | 1,456 | 6,834 | +369% | 0 | 0 | — |
case-07 | fail→pass | 8,563 | 4,325 | -49% | 1 | 1 | 0% | 1,415 | 6,214 | +339% | 0 | 0 | — |
case-08 | fail→pass | 6,964 | 3,849 | -45% | 1 | 1 | 0% | 1,168 | 5,992 | +413% | 0 | 0 | — |
case-09 | fail→pass | 7,616 | 4,966 | -35% | 1 | 1 | 0% | 1,397 | 6,333 | +353% | 0 | 0 | — |
case-10 | fail→pass | 6,292 | 3,059 | -51% | 1 | 1 | 0% | 1,118 | 5,878 | +426% | 0 | 0 | — |
case-11 | fail→pass | 10,271 | 5,123 | -50% | 1 | 1 | 0% | 1,772 | 6,266 | +254% | 0 | 0 | — |
case-12 | fail→pass | 7,306 | 4,129 | -43% | 1 | 1 | 0% | 1,470 | 6,300 | +329% | 0 | 0 | — |
case-13 | pass→pass | 7,191 | 3,188 | -56% | 1 | 1 | 0% | 1,273 | 5,925 | +365% | 0 | 0 | — |
case-14 | fail→pass | 11,718 | 2,847 | -76% | 1 | 1 | 0% | 1,894 | 5,846 | +209% | 0 | 0 | — |
case-15 | fail→pass | 10,736 | 2,703 | -75% | 1 | 1 | 0% | 1,783 | 5,860 | +229% | 0 | 0 | — |
case-16 | fail→pass | 6,933 | 3,215 | -54% | 1 | 1 | 0% | 1,180 | 5,905 | +400% | 0 | 0 | — |
case-17 | pass→pass | 7,367 | 3,505 | -52% | 1 | 1 | 0% | 1,325 | 5,909 | +346% | 0 | 0 | — |
case-18 | fail→pass | 9,116 | 3,218 | -65% | 1 | 1 | 0% | 1,506 | 5,968 | +296% | 0 | 0 | — |
case-19 | fail→pass | 8,623 | 3,186 | -63% | 1 | 1 | 0% | 1,407 | 5,922 | +321% | 0 | 0 | — |
case-20 | fail→pass | 14,013 | 4,496 | -68% | 1 | 1 | 0% | 2,518 | 6,277 | +149% | 0 | 0 | — |
case-21 | fail→pass | 8,433 | 3,233 | -62% | 1 | 1 | 0% | 1,373 | 5,959 | +334% | 0 | 0 | — |
case-22 | pass→pass | 8,228 | 5,090 | -38% | 1 | 1 | 0% | 1,248 | 6,348 | +409% | 0 | 0 | — |
case-23 | fail→pass | 9,226 | 1,705 | -82% | 1 | 1 | 0% | 1,678 | 5,678 | +238% | 0 | 0 | — |
case-24 | fail→pass | 5,847 | 2,483 | -58% | 1 | 1 | 0% | 1,142 | 5,861 | +413% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +75 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.