模板下子码列表
分页获取某个批量模板下的子码。拿到子码 coding 后可继续调 子码内容。
请求示例
python
import requests
url = "https://open.cli.im/api/v2/rpc/templates/listQrcodes"
data = {"template": "tA9kQ2f", "page_size": 20}
headers = {
"Authorization": "Bearer <你的API Key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=data, headers=headers)
print(response.text)bash
curl -X POST 'https://open.cli.im/api/v2/rpc/templates/listQrcodes' \
-H 'Authorization: Bearer <你的API Key>' \
-H 'Content-Type: application/json' \
-d '{"template": "tA9kQ2f", "page_size": 20}'请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
template | string | 是 | 占位码 coding 或完整 URL |
start_time | string | 否 | 起始时间(ISO 8601),按创建时间过滤 |
end_time | string | 否 | 结束时间(ISO 8601) |
page_token | string | 否 | 上一页返回的 next_page_token;首页不传 |
page_size | integer | 否 | 每页条数,默认 20,上限 100 |
完整返回示例
json
{
"code": 0,
"message": "ok",
"data": {
"list": [
{ "name": "1号灭火器", "id": 990201, "coding": "sK2mP9a" },
{ "name": "2号灭火器", "id": 990202, "coding": "sL5nQ3b" }
],
"next_page_token": null,
"total": 2
}
}响应结构
| 路径 | 类型 | 说明 |
|---|---|---|
data.list[].name | string | 子码名称 |
data.list[].id | integer | 子码 ID |
data.list[].coding | string | 子码 coding,子码内容 的入参 |
data.next_page_token | string|null | 下一页游标;为 null 表示已到最后一页 |
data.total | integer | 满足条件的总条数 |
错误响应
占位码不存在或无权限时返回 404:
json
{
"code": 404,
"message": "Template not found or access denied",
"data": {}
}其余错误码定义见:错误码说明。