本接口支持通过指定服务 ID,获取该服务下回收站内所有模板信息。
说明
veImageX 在全球多个区域部署,每个区域有自己对应的 OpenAPI 域名,不支持跨区域调用。具体详情请查看服务地址。
以下请求参数列表仅列出了该接口的部分公共参数,完整公共参数列表见公共参数。
| 参数 | 类型 | 是否必选 | 描述 |
|---|---|---|---|
| Action | String | 是 | 接口名称。 |
| Version | String | 是 | 接口版本。veImageX 当前 API 的版本为 2018-08-01。 |
ServiceId | String | 是 | 服务 ID |
| TemplateNamePattern | String | 否 | 仅返回模板名称包含该字符串的图片模板,不填或者为空则返回所有模板。 |
| Offset | Integer | 否 | 分页偏移。默认 0。取值为1,表示跳过第一条数据,从第二条数据开始取值。 |
| Limit | Integer | 否 | 分页获取条数,默认 10。 |
| Asc | String | 否 | 是否按照模板创建时间升序查询,支持取值:true、false,默认为false。 |
| 参数 | 类型 | 描述 |
|---|---|---|
| Total | Integer | 模板总数。 |
| Templates | Array of Templates | 所有模板信息 |
| 参数 | 类型 | 描述 |
|---|---|---|
| ServiceID | String | 服务 ID。 |
| TemplateName | String | 模板名称。 |
| Content | String | 模版 JSON 内容。 |
| CreateAt | String | 模板创建时间。 |
| Abstract | Array of String | 模板的摘要信息。 |
WithSig | Bool | 模板是否开启鉴权。
|
| Parameters | Array of String | 图片模板的参数列表,URL 中下发参数的顺序需要跟列表中的保持一致。 |
| ReqDeadline | String | URL 的失效期,为 Unix 时间戳。 |
| OuputQuality | Integer | 对图片编码使用的质量参数。 |
OutputFormat | String | 该模板计划使用的输出图片格式。
|
| DemotionFormat | String | 模版降级格式,仅针对 heic 格式有效。 |
| Sync | Bool | 是否同步处理,仅针对 heic 格式有效。 |
| Usage | String | 该模板的使用用例。 |
| Filters | Array of Filters | 对图片的编辑操作。 |
OutputExtra | JSON Map | 用于图片服务输出时的图片编码。
|
| AdaptiveFmt | JSON Map | 指定图像自适应配置。 |
| Snapshot | JSON Map | 视频截帧配置。 |
| Animation | JSON Map | 视频转动图配置。 |
| 参数 | 类型 | 描述 |
|---|---|---|
png.use_quant | String | 是否压缩颜色空间。默认关闭。 |
jpeg.progressive | String | 是否采用 jpeg 渐进编码格式。默认关闭。 |
heic.roi | String | 是否开启 ROI 编码。仅当 |
heic.encode.depth | String | 色位深度。仅当 |
| heic.thumb.ratio | String | 缩略图比例,仅当OutputFormat取值为heic时配置有效,开启后默认为 5。默认关闭。 |
heic.alpha.reserve | String | 是否带 ALPHA 透明通道编码。仅当 |
说明
自适应的具体原理说明请参考实现原理。
| 参数 | 类型 | 描述 |
|---|---|---|
Static | String | 静图自适应,支持取值:webp、heic、avif、dynamic。 |
Animated | String | 动图自适应,支持取值:webp、heic、avif、dynamic。 |
| 参数 | 类型 | 描述 |
|---|---|---|
Type | String | 截图类型。 |
| TimeOffsetMs | Integer | 截图的时间戳,单位为 ms。 |
| 参数 | 类型 | 描述 |
|---|---|---|
| StartTime | Integer | 动图起始时间戳,单位为 ms。 |
| Duration | Integer | 动图时长,单位为 ms。 |
SelectFrameMode | String | 抽帧策略。
|
| FramePerSecond | Integer | 帧率,1 秒 X 帧。仅当SelectFrameMode取值为fps时,需要配置。 |
| SecondPerFrame | Integer | 秒数,X 秒 1 帧。仅当SelectFrameMode取值为spf时,需要配置。 |
| WaitTime | Integer | 同步等待时长,单位为 s,超时未完成则根据DemotionType降级。 |
DemotionType | String | 降级类型。
|
| 参数 | 类型 | 描述 |
|---|---|---|
| Name | String | 编辑操作的名称,具体详情请见图片编辑数据结构。 |
| Param | JSON Map | 编辑操作的参数,具体详情请见图片编辑数据结构。 |
GET https://imagex.volcengineapi.com/?Action=GetTemplatesFromBin&Version=2018-08-01&ServiceId=fc5**cf
{ "ResponseMetadata": { "RequestId": "201806041104200100100232280022D30", "Action": "GetTemplatesFromBin", "Version": "2018-08-01", "Service": "imagex", "Region": "cn-north-1" }, "Result": { "Templates": [ { "TemplateName": "tplv-xyz-xxx@2022-08-23T20:25:26+08:00", "CreateAt": "2018-05-09 17:44:40", "Abstract": [ "缩略:等比缩放", "效果:模糊半径20" ], "WithSig": false, "Parameters": [ "width" ], "ReqDeadline": "", "OuputQuality": 85, "OutputFormat": "image", "Sync": false, "Usage": "~tplv-xyz-xxx:width.image", "Filters": [ { "Name": "resize", "Param": { "width": "${width}", "height": 0, "keepratio": true } } ] } ] } }
{ "ResponseMetadata": { "RequestId": "201806041104200100100232280022D30", "Action": "GetAllImageTemplates", "Version": "2018-08-01", "Service": "imagex", "Region": "cn-north-1" "Error": { "Code": "RetrieveTemplatesFailure", "Message": "Service not found." } } }