查询模板列表(V1)
功能介绍
查询模板列表,推荐使用/v1/templates/query接口。
调试
您可以在API Explorer中调试该接口。
URI
GET /v1/templates
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
keyword | 否 | String | 搜索关键字,支持按名称和描述搜索,默认null。 |
offset | 否 | Integer | 偏移量,表示从此偏移量开始查询,offset大于等于0。 |
limit | 否 | Integer | 每页的模板条数,默认10。 |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Language | 否 | String | 语言类型,缺省值为“zh-cn”。 枚举值:
|
响应参数
状态码: 200
参数 | 参数类型 | 描述 |
|---|---|---|
count | Integer | 返回模板的数量。 |
templates | Array of TemplateSimpleInfo objects | 返回模板的列表。 |
请求示例
GET https://{endpoint}/v1/templates?keyword=test&limit=10&offset=0 响应示例
状态码: 200
ok
{
"count" : 1,
"templates" : [ {
"id" : "406dd67aaa7b401892ede527b9966d33",
"title" : "测试模板",
"description" : "这是一个测试模板"
} ]
} 状态码: 400
Bad Request
{
"error_code" : "DEVSTAR.1001",
"error_msg" : "limit : 非法参数"
} 状态码
状态码 | 描述 |
|---|---|
200 | ok |
400 | Bad Request |
错误码
请参见错误码。

