快速开始
QR Cake API 让 QR Cake 用户可以管理自己账户下的二维码。
基础 URL
https://api.qrcake.com/v1/product
身份验证
在控制台创建一个 API 密钥,并在 Authorization 请求头中发送。
Authorization: Bearer <API Key> Content-Type: application/json
在以下位置管理 API 密钥: 控制台 API 密钥.
API 请求测试工具
直接在本页面测试各接口。输入你的 API 密钥,选择一个接口,即可查看实时响应。
交互式 API 测试工具
直接在浏览器中向所选的 QR Cake API 接口发起请求。
Authorization: Bearer YOUR_API_KEY解析后的 URL
https://api.qrcake.com/v1/product/user/product
发送请求后,可在此查看实时状态码和响应内容。
术语说明
产品
二维码
用户
QR Cake 账户
请求体(POST/PUT)
对于 POST 和 PUT 请求,请求体需要先字符串化。如果发送的是 JSON,请传入 JSON 字符串(例如 JSON.stringify(payload)).
const payload = { redirect: "https://example.com", metadata: {} };
await fetch(url, {
method: "POST",
body: JSON.stringify(payload),
});GET
获取二维码列表
列出当前 API 密钥可访问的二维码。
路径: /user/product
URL: https://api.qrcake.com/v1/product/user/product
请求详情
请求头
Authorization: Bearer <API Key>Accept: application/json
响应
200 OK
[
{
"accountId": "string",
"productId": "string",
"userId": "string",
"redirect": "string",
"state": "ACTIVE",
"metadata": {},
"createdAt": 0,
"updatedAt": 0
}
]401 未授权
{
"message": {}
}Products 即二维码。
GET
获取单个二维码
获取一个二维码的详情。
路径: /product/{productId}
URL: https://api.qrcake.com/v1/product/product/{productId}
请求详情
路径参数
- productId (string)
请求头
Authorization: Bearer <API Key>Accept: application/json
响应
200 OK
{
"accountId": "string",
"productId": "string",
"userId": "string",
"redirect": "string",
"state": "ACTIVE",
"metadata": {},
"createdAt": 0,
"updatedAt": 0
}401 未授权
{
"message": {}
}POST
创建二维码
创建一个新的二维码产品。
路径: /product
URL: https://api.qrcake.com/v1/product/product
请求详情
请求头
Authorization: Bearer <API Key>Content-Type: application/jsonAccept: application/json
请求体模板
{
"redirect": "https://example.com",
"metadata": {},
"state": "ACTIVE"
}响应
200 OK
{
"accountId": "string",
"productId": "string",
"userId": "string",
"redirect": "string",
"state": "ACTIVE",
"metadata": {},
"createdAt": 0,
"updatedAt": 0
}401 未授权
{
"message": {}
}POST 请求体必须字符串化(例如 JSON.stringify(payload))。
PUT
更新二维码
更新一个已有的二维码(product)。
路径: /product/{productId}
URL: https://api.qrcake.com/v1/product/product/{productId}
请求详情
路径参数
- productId (string)
请求头
Authorization: Bearer <API Key>Content-Type: application/jsonAccept: application/json
请求体模板
{
"redirect": "https://example.com",
"metadata": {},
"state": "ACTIVE"
}响应
200 OK
{
"accountId": "string",
"productId": "string",
"userId": "string",
"redirect": "string",
"state": "ACTIVE",
"metadata": {},
"expiresAt": 0,
"createdAt": 0,
"updatedAt": 0
}401 未授权
{
"message": {}
}PUT 请求体必须字符串化。
DELETE
删除二维码
删除一个二维码。
路径: /product/{productId}
URL: https://api.qrcake.com/v1/product/product/{productId}
请求详情
路径参数
- productId (string)
请求头
Authorization: Bearer <API Key>Accept: application/json
响应
200 OK
{
"productId": "string"
}401 未授权
{
"message": {}
}GET
权限
返回该 API 密钥所获得的权限。
路径: /permission
URL: https://api.qrcake.com/v1/product/permission
请求详情
请求头
Authorization: Bearer <API Key>Accept: application/json
响应
200 OK
{
"success": true,
"result": {
"analytics": true,
"productLimit": 100,
"tier": "subscriber",
"productTotal": 3,
"productActiveLimit": 100,
"productActiveTotal": 3
}
}401 未授权
{
"message": {}
}支持的二维码类型
创建或更新二维码产品时,请使用这些元数据类型。
redirect, link, image, video, file, pdf, audio, app, event, vCard