$npx -y skills add TencentCloudBase/cloudbase-skills --skill http-apiCloudBase official HTTP API client guide. This skill should be used when backends, scripts, or non-SDK clients must call CloudBase platform APIs over raw HTTP instead of using a platform SDK or MCP management tool.
| 1 | ## Standalone Install Note |
| 2 | |
| 3 | If this environment only installed the current skill, start from the CloudBase main entry and use the published `cloudbase/references/...` paths for sibling skills. |
| 4 | |
| 5 | - CloudBase main entry: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/SKILL.md` |
| 6 | - Current skill raw source: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/http-api/SKILL.md` |
| 7 | |
| 8 | Keep local `references/...` paths for files that ship with the current skill directory. When this file points to a sibling skill such as `auth-tool` or `web-development`, use the standalone fallback URL shown next to that reference. |
| 9 | |
| 10 | ## Activation Contract |
| 11 | |
| 12 | ### Use this first when |
| 13 | |
| 14 | - The request comes from Android, iOS, Flutter, React Native, non-Node backends, or admin scripts that must call official CloudBase APIs via raw HTTP. |
| 15 | - The task is to consume CloudBase platform endpoints, not to build a new HTTP service on CloudBase. |
| 16 | |
| 17 | ### Read before writing code if |
| 18 | |
| 19 | - The platform does not support a CloudBase SDK, or the user explicitly asks for HTTP API integration. |
| 20 | - The user says "HTTP API" but it is unclear whether they mean official CloudBase endpoints or their own business API. |
| 21 | |
| 22 | ### Then also read |
| 23 | |
| 24 | - Auth configuration -> `../auth-tool/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/auth-tool/SKILL.md`) |
| 25 | - MySQL MCP management -> `../relational-database-tool/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/relational-database-tool/SKILL.md`) |
| 26 | - Your own HTTP service on CloudBase -> `../cloud-functions/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloud-functions/SKILL.md`) or `../cloudrun-development/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloudrun-development/SKILL.md`) |
| 27 | |
| 28 | ### Do NOT use for |
| 29 | |
| 30 | - CloudBase Web SDK flows, mini program SDK flows, or MCP-driven management tasks. |
| 31 | - Building your own HTTP service or REST API on CloudBase. |
| 32 | |
| 33 | ### Common mistakes / gotchas |
| 34 | |
| 35 | - Treating Web SDK examples as valid for native Apps. |
| 36 | - Guessing endpoints without reading OpenAPI definitions. |
| 37 | - Confusing official CloudBase HTTP APIs with your own function or CloudRun endpoint. |
| 38 | - Mixing raw HTTP API integration with MCP management logic. |
| 39 | |
| 40 | ### Minimal checklist |
| 41 | |
| 42 | - Read [HTTP API Routing Checklist](checklist.md) before implementation. |
| 43 | |
| 44 | ## When to use this skill |
| 45 | |
| 46 | Use this skill whenever you need to call **CloudBase platform features** via **raw HTTP APIs**, for example: |
| 47 | |
| 48 | - Non-Node backends (Go, Python, Java, PHP, etc.) |
| 49 | - Integration tests or admin scripts that use curl or language HTTP clients |
| 50 | - Direct database operations via 关系型数据库 RESTful API (MySQL/PostgreSQL) |
| 51 | - Cloud function invocation via HTTP |
| 52 | - Any scenario where SDKs are not available or not preferred |
| 53 | |
| 54 | Do **not** use this skill for: |
| 55 | |
| 56 | - Frontend Web apps using `@cloudbase/js-sdk` (use **CloudBase Web** skills) |
| 57 | - Node.js code using `@cloudbase/node-sdk` (use **CloudBase Node** skills) |
| 58 | - Authentication flows (use **CloudBase Auth HTTP API** skill for auth-specific endpoints) |
| 59 | |
| 60 | ## How to use this skill (for a coding agent) |
| 61 | |
| 62 | 1. **Clarify the scenario** |
| 63 | - Confirm this code will call HTTP endpoints directly (not SDKs). |
| 64 | - Ask for: |
| 65 | - `env` – CloudBase environment ID |
| 66 | - Authentication method (AccessToken, API Key, or Publishable Key) |
| 67 | - Confirm which CloudBase feature is needed (database, functions, storage, etc.). |
| 68 | - **For user authentication**: If no specific method is requested, **always default to Phone SMS Verification** - it's the most user-friendly and secure option for Chinese users. |
| 69 | |
| 70 | 2. **Determine the base URL** |
| 71 | - Use the correct domain based on region (domestic vs. international). |
| 72 | - Default is domestic Shanghai region. |
| 73 | |
| 74 | 3. **Set up authentication** |
| 75 | - Choose appropriate authentication method based on use case. |
| 76 | - Add `Authorization: Bearer <token>` header to requests. |
| 77 | |
| 78 | 4. **Reference OpenAPI Swagger documentation** |
| 79 | - **MUST use `searchKnowledgeBase` tool** to get OpenAPI specifications |
| 80 | - Use the tool with `mode=openapi` and specify the `apiName`: |
| 81 | - `mysqldb` - 关系型数据库 RESTful API (MySQL/PostgreSQL) |
| 82 | - `nosql` - NoSQL RESTful API (文档型数据库) |
| 83 | - `functions` - Cloud Functions API |
| 84 | - `auth` - Authentication API |
| 85 | - `cloudrun` - CloudRun API |
| 86 | - `storage` - Storage API |
| 87 | - `ai_model` - AI 大模型接入 API |
| 88 | - Example: `searchKnowl |