快速流程
GET {base_url}/manifest.json— 获取tools[]、base_url、全局protocol。- 对每个工具:
GET {base_url}{schema_url}— 读取method、parameters、成功响应与errors.by_status。 POST {base_url}{api_url}— 请求头Content-Type: application/json; charset=utf-8,请求体为 JSON,字段名以 schema 为准。
manifest.protocol
protocol.kind 固定为 keyong-tools-manifest。url_resolution.rules 说明相对路径一律拼在 base_url 之后。
protocol.error_envelope:HTTP 非 2xx 时,响应体为 JSON,且包含字符串字段 error。
protocol.auth.type 当前为 none;若变更会提升版本号并在 manifest 中声明。
示例:二维码
curl -sS -X POST "https://clawam.com/api/qrcode/" \
-H "Content-Type: application/json" \
-d '{"text":"https://clawam.com","size":300,"format":"png"}'
Schema 与错误
每个工具在 /tools/<name>/schema.json 中提供 errors.envelope 与 errors.by_status,与线上 API 返回对齐。
链接
- /manifest.json — 工具列表与各工具的
schema_url、api_url入口。 - 示例 schema(当前 manifest 中唯一工具,路径以线上 manifest 为准):/tools/qrcode/schema.json