http-api-cloudbase

0
0
Source

Use CloudBase HTTP API to access CloudBase platform features (database, authentication, cloud functions, cloud hosting, cloud storage, AI) via HTTP protocol from backends or scripts that are not using SDKs.

Install

mkdir -p .claude/skills/http-api-cloudbase && curl -L -o skill.zip "https://mcp.directory/api/skills/download/4719" && unzip -o skill.zip -d .claude/skills/http-api-cloudbase && rm skill.zip

Installs to .claude/skills/http-api-cloudbase

About this skill

Activation Contract

Use this first when

  • The request comes from Android, iOS, Flutter, React Native, non-Node backends, or admin scripts that must call CloudBase via raw HTTP.

Read before writing code if

  • The platform does not support a CloudBase SDK, or the user explicitly asks for HTTP API integration.

Then also read

  • Auth configuration -> ../auth-tool/SKILL.md
  • MySQL MCP management -> ../relational-database-tool/SKILL.md

Do NOT use for

  • CloudBase Web SDK flows, mini program SDK flows, or MCP-driven management tasks.

Common mistakes / gotchas

  • Treating Web SDK examples as valid for native Apps.
  • Guessing endpoints without reading OpenAPI definitions.
  • Mixing raw HTTP API integration with MCP management logic.

Minimal checklist

When to use this skill

Use this skill whenever you need to call CloudBase platform features via raw HTTP APIs, for example:

  • Non-Node backends (Go, Python, Java, PHP, etc.)
  • Integration tests or admin scripts that use curl or language HTTP clients
  • Direct database operations via MySQL RESTful API
  • Cloud function invocation via HTTP
  • Any scenario where SDKs are not available or not preferred

Do not use this skill for:

  • Frontend Web apps using @cloudbase/js-sdk (use CloudBase Web skills)
  • Node.js code using @cloudbase/node-sdk (use CloudBase Node skills)
  • Authentication flows (use CloudBase Auth HTTP API skill for auth-specific endpoints)

How to use this skill (for a coding agent)

  1. Clarify the scenario

    • Confirm this code will call HTTP endpoints directly (not SDKs).
    • Ask for:
      • env – CloudBase environment ID
      • Authentication method (AccessToken, API Key, or Publishable Key)
    • Confirm which CloudBase feature is needed (database, functions, storage, etc.).
    • 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.
  2. Determine the base URL

    • Use the correct domain based on region (domestic vs. international).
    • Default is domestic Shanghai region.
  3. Set up authentication

    • Choose appropriate authentication method based on use case.
    • Add Authorization: Bearer <token> header to requests.
  4. Reference OpenAPI Swagger documentation

    • MUST use searchKnowledgeBase tool to get OpenAPI specifications
    • Use the tool with mode=openapi and specify the apiName:
      • mysqldb - MySQL RESTful API
      • functions - Cloud Functions API
      • auth - Authentication API
      • cloudrun - CloudRun API
      • storage - Storage API
    • Example: searchKnowledgeBase({ mode: "openapi", apiName: "mysqldb" })
    • Parse the returned YAML content to understand exact endpoint paths, parameters, request/response schemas
    • Never invent endpoints or parameters - always reference the swagger documentation

Overview

CloudBase HTTP API is a set of interfaces for accessing CloudBase platform features via HTTP protocol, supporting database, user authentication, cloud functions, cloud hosting, cloud storage, AI, and more.

OpenAPI Swagger Documentation

⚠️ IMPORTANT: Always use searchKnowledgeBase tool to get OpenAPI Swagger specifications

Before implementing any HTTP API calls, you should:

  1. Use searchKnowledgeBase tool to get OpenAPI documentation:

    searchKnowledgeBase({ mode: "openapi", apiName: "<api-name>" })
    
  2. Available API names:

    • mysqldb - MySQL RESTful API
    • functions - Cloud Functions API
    • auth - Authentication API
    • cloudrun - CloudRun API
    • storage - Storage API
  3. Parse and use the swagger documentation:

    • Extract exact endpoint paths and HTTP methods
    • Understand required and optional parameters
    • Review request/response schemas
    • Check authentication requirements
    • Verify error response formats
  4. Never invent API endpoints or parameters - always base your implementation on the official swagger documentation.

Prerequisites

Before starting, ensure you have:

  1. CloudBase environment created and activated
  2. Authentication credentials (AccessToken, API Key, or Publishable Key)

Authentication and Authorization

CloudBase HTTP API requires authentication. Choose the appropriate method based on your use case:

AccessToken Authentication

Applicable environments: Client/Server
User permissions: Logged-in user permissions

How to get: Use searchKnowledgeBase({ mode: "openapi", apiName: "auth" }) to get the Authentication API specification

API Key

Applicable environments: Server
User permissions: Administrator permissions

⚠️ Warning: Tokens are critical credentials for identity authentication. Keep them secure. API Key must NOT be used in client-side code.

Publishable Key

Applicable environments: Client/Server
User permissions: Anonymous user permissions

💡 Note: Can be exposed in browsers, used for requesting publicly accessible resources, effectively reducing MAU.

API Endpoint URLs

CloudBase HTTP API uses unified domain names for API calls. The domain varies based on the environment's region.

Domestic Regions

For environments in domestic regions like Shanghai (ap-shanghai), use:

https://{your-env}.api.tcloudbasegateway.com

Replace {your-env} with the actual environment ID. For example, if environment ID is cloud1-abc:

https://cloud1-abc.api.tcloudbasegateway.com

International Regions

For environments in international regions like Singapore (ap-singapore), use:

https://{your-env}.api.intl.tcloudbasegateway.com

Replace {your-env} with the actual environment ID. For example, if environment ID is cloud1-abc:

https://cloud1-abc.api.intl.tcloudbasegateway.com

Using Authentication in Requests

Add the token to the request header:

Authorization: Bearer <access_token/apikey/publishable_key>

:::warning Note

When making actual calls, replace the entire part including angle brackets (< >) with your obtained key. For example, if the obtained key is eymykey, fill it as:

Authorization: Bearer eymykey

:::

Usage Examples

Cloud Function Invocation Example

curl -X POST "https://your-env-id.api.tcloudbasegateway.com/v1/functions/YOUR_FUNCTION_NAME" \
  -H "Authorization: Bearer <access_token/apikey/publishable_key>" \
  -H "Content-Type: application/json" \
  -d '{"name": "张三", "age": 25}'

For detailed API specifications, always download and reference the OpenAPI Swagger files mentioned above.

MySQL RESTful API

The MySQL RESTful API provides all MySQL database operations via HTTP endpoints.

Base URL Patterns

Support three domain access patterns:

  1. https://{envId}.api.tcloudbasegateway.com/v1/rdb/rest/{table}
  2. https://{envId}.api.tcloudbasegateway.com/v1/rdb/rest/{schema}/{table}
  3. https://{envId}.api.tcloudbasegateway.com/v1/rdb/rest/{instance}/{schema}/{table}

Where:

  • envId is the environment ID
  • instance is the database instance identifier
  • schema is the database name
  • table is the table name

If using the system database, recommend pattern 1.

Request Headers

HeaderParameterDescriptionExample
Acceptapplication/json, application/vnd.pgrst.object+jsonControl data return formatAccept: application/json
Content-Typeapplication/json, application/vnd.pgrst.object+jsonRequest content typeContent-Type: application/json
PreferOperation-dependent feature values- return=representation Write operation, return data body and headers<br>- return=minimal Write operation, return headers only (default)<br>- count=exact Read operation, specify count<br>- resolution=merge-duplicates Upsert operation, merge conflicts<br>- resolution=ignore-duplicates Upsert operation, ignore conflictsPrefer: return=representation
AuthorizationBearer <token>Authentication tokenAuthorization: Bearer <access_token>

Query Records

GET /v1/rdb/rest/{table}

Query Parameters:

  • select: Field selection, supports * or field list, supports join queries like class_id(grade,class_number)
  • limit: Limit return count
  • offset: Offset for pagination
  • order: Sort field, format field.asc or field.desc

Example:

# Before URL encoding
curl -X GET 'https://your-env.api.tcloudbasegateway.com/v1/rdb/rest/course?select=name,position&name=like.%张三%&title=eq.文章标题' \
  -H "Authorization: Bearer <access_token>"

# After URL encoding
curl -X GET 'https://your-env.api.tcloudbasegateway.com/v1/rdb/rest/course?select=name,position&name=like.%%E5%BC%A0%E4%B8%89%&title=eq.%E6%96%87%E7%AB%A0%E6%A0%87%E9%A2%98' \
  -H "Authorization: Bearer <access_token>"

Response Headers:

  • Content-Range: Data range, e.g., 0-9/100 (0=start, 9=end, 100=total)

Insert Records

POST /v1/rdb/rest/{table}

Request Body: JSON object or array of objects

💡 Note about _openid: When a user is logged in (using AccessToken authentication), the _openid field is automatically populated by the server with the current user's identity. You do NOT need to manually set this field in INSERT operations - the server will fill it automatically based on the authenticated user's session.

Example:

curl -X POST 'https://your-env.api.t

---

*Content truncated.*

spec-workflow

TencentCloudBase

Standard software engineering workflow for requirement analysis, technical design, and task planning. Use this skill when developing new features, complex architecture designs, multi-module integrations, or projects involving database/UI design.

773

auth-web-cloudbase

TencentCloudBase

CloudBase Web Authentication Quick Guide - Provides concise and practical Web frontend authentication solutions with multiple login methods and complete user management.

30

ai-model-nodejs

TencentCloudBase

Use this skill when developing Node.js backend services or CloudBase cloud functions (Express/Koa/NestJS, serverless, backend APIs) that need AI capabilities. Features text generation (generateText), streaming (streamText), AND image generation (generateImage) via @cloudbase/node-sdk ≥3.16.0. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended), DeepSeek (deepseek-v3.2 recommended), and hunyuan-image for images. This is the ONLY SDK that supports image generation. NOT for browser/Web apps (use ai-model-web) or WeChat Mini Program (use ai-model-wechat).

00

cloud-functions

TencentCloudBase

Complete guide for CloudBase cloud functions development - runtime selection, deployment, logging, invocation, and HTTP access configuration.

00

auth-wechat-miniprogram

TencentCloudBase

Complete guide for WeChat Mini Program authentication with CloudBase - native login, user identity, and cloud function integration.

00

data-model-creation

TencentCloudBase

Optional advanced tool for complex data modeling. For simple table creation, use relational-database-tool directly with SQL statements.

00

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

643969

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

591705

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

318398

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

339397

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

451339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.