
# 查询自定义模板组集合 - ListTemplateGroupCollection
#### 功能介绍
查询转码模板组集合。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/VOD/doc?api=ListTemplateGroupCollection)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-vod/vod_04_0012.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                         | 访问级别 | 资源类型（\*为必须） | 条件键 | 别名 | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | vod:templateCollection:list | List | -           | -   | -  | -      |
     
  
 
#### URI
GET /v1.0/{project_id}/asset/template-collection/transcodings
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                             |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID，获取方法请参考[获取项目ID](https://support.huaweicloud.com/api-vod/vod_04_0211.html) |
   
表2Query参数 
| 参数                  | 是否必选 | 参数类型    | 描述                                                   |
|:---|:---|:---|:---|
| group_collection_id | 否    | String  | 模板组集合id                                              |
| offset              | 否    | Integer | 偏移量。默认为0。指定group_collection_id时该参数无效。                |
| limit               | 否    | Integer | 每页记录数。默认为10，范围\[1,100\]。指定group_collection_id时该参数无效。 |
   
#### 请求参数
表3请求Header参数 
| 参数            | 是否必选 | 参数类型   | 描述                                                                                                                      |
|:---|:---|:---|:---|
| X-Auth-Token  | 否    | String | 用户Token，使用Token鉴权方式时必选。 通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。 |
| Authorization | 否    | String | 使用AK/SK方式认证时必选，携带的鉴权信息。                                                                                                 |
| X-Sdk-Date    | 否    | String | 使用AK/SK方式认证时必选，请求的发生时间。                                                                                                 |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数                             | 参数类型                                                                                                       | 描述      |
|:---|:---|:---|
| template_group_collection_list | Array of [TemplateGroupCollection] objects | 模板组集合信息 |
| total                          | Integer                                                                                                    | 总记录条数   |
   
 表5TemplateGroupCollection 
| 参数                  | 参数类型                                                                                   | 描述      |
|:---|:---|:---|
| group_collection_id | String                                                                                 | 模板组集合id |
| name                | String                                                                                 | 模板组集合名称 |
| description         | String                                                                                 | 模板介绍    |
| template_group_list | Array of [TemplateGroup] objects | 转码组列表   |
   
 表6TemplateGroup 
| 参数                     | 参数类型                                                                               | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|
| group_id               | String                                                                             | 模板组id                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| name                   | String                                                                             | 模板组名称                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| status                 | String                                                                             | 是否默认。 - 0：非默认   - 1：默认                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| type                   | String                                                                             | 模板组类型。 - system_template_group：系统模板组   - custom_template_group：自定义模板组   - non_transcoding_template_group：系统模板组，不转码模板   - adaptive_template_group：系统模板组，自适应模板    |
| auto_encrypt           | Integer                                                                            | 是否自动加密。 取值如下： - 0：表示不加密。   - 1：表示需要加密。    默认值：0。 加密与转码必须要一起进行，当需要加密时，转码参数不能为空，且转码输出格式必须要为HLS。                                                                                                                                                                                                                                                                                                   |
| quality_info_list      | Array of [QualityInfo] objects | 画质配置信息列表                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| watermark_template_ids | Array of strings                                                                   | 绑定的水印模板组ID数组                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| description            | String                                                                             | 模板介绍                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| common                 | [Common] object                     | 高清低码开关，高清低码版本，编码格式多路共同参数                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   
 表7QualityInfo 
| 参数     | 参数类型                                                                                 | 描述     |
|:---|:---|:---|
| video  | [VideoTemplateInfo] object | 模板视频信息 |
| audio  | [AudioTemplateInfo] object | 模板音频信息 |
| format | String                                                                               | 格式。    |
   
 表8VideoTemplateInfo 
| 参数         | 参数类型    | 描述                      |
|:---|:---|:---|
| quality    | String  | 画质。                     |
| width      | Integer | 视频宽度。                   |
| height     | Integer | 视频高度。                   |
| bitrate    | Integer | 码率。                     |
| frame_rate | Integer | 帧率（默认为1，1代表自适应，单位是帧每秒）。 |
   
 表9AudioTemplateInfo 
| 参数          | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|:---|:---|:---|
| sample_rate | Integer | 音频采样率（有效值范围） - 1：AUDIO_SAMPLE_AUTO   - 2：AUDIO_SAMPLE_22050   - 3：AUDIO_SAMPLE_32000   - 4：AUDIO_SAMPLE_44100   - 5：AUDIO_SAMPLE_48000   - 6：AUDIO_SAMPLE_96000    默认值为1。 |
| bitrate     | Integer | 音频码率（单位：Kbps）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| channels    | Integer | 声道数（有效值范围） - 1：AUDIO_CHANNELS_1   - 2：AUDIO_CHANNELS_2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
   
 表10Common 
| 参数           | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|:---|:---|:---|
| pvc          | String  | 高清低码开关。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| pvc_version  | String  | 高清低码版本。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| video_codec  | String  | 视频编码格式。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| audio_codec  | String  | 音频编码格式（有效值范围） - 1：AUDIO_CODECTYPE_AAC   - 2：AUDIO_CODECTYPE_HEAAC1   - 3：AUDIO_CODECTYPE_HEAAC2   - 4：AUDIO_CODECTYPE_MP3    默认值为1。 |
| hls_interval | Integer | 分片时长（默认为5秒）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   
**状态码：400**
表11响应Body参数 
| 参数         | 参数类型   | 描述    |
|:---|:---|:---|
| error_code | String | 错误码。  |
| error_msg  | String | 错误描述。 |
   
#### 请求示例
查询转码模板集合
```
GET https://{endpoint}/v1.0/{project_id}/asset/template-collection/transcodings
```
#### 响应示例
**状态码：200**
处理成功返回。
```
{
  "template_group_collection_list" : [ {
    "group_collection_id" : "9751249d25f14587b212544d6fd8dcf8",
    "name" : "test",
    "template_group_list" : [ {
      "group_id" : "9751249d25f14587b212544d6fd8dcf8",
      "name" : "test112",
      "status" : "0",
      "type" : "custom_template_group",
      "auto_encrypt" : 0,
      "quality_info_list" : [ {
        "video" : {
          "quality" : "UNKNOW",
          "width" : 0,
          "height" : 0,
          "bitrate" : 0,
          "frame_rate" : 0
        },
        "audio" : null,
        "format" : "UNKNOW"
      } ],
      "watermark_template_ids" : null,
      "description" : null,
      "common" : {
        "pvc" : null,
        "pvc_version" : null,
        "video_codec" : null,
        "audio_codec" : "AAC",
        "hls_interval" : 0
      }
    } ]
  } ],
  "total" : 1
}
```
**状态码：400**
处理失败返回。
```
{
  "error_code" : "VOD.10053",
  "error_msg" : "The request parameter is illegal, illegal field: {xx}."
}
```
#### 状态码
| 状态码 | 描述      |
|:---|:---|
| 200 | 处理成功返回。 |
| 400 | 处理失败返回。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-vod/ErrorCode.html)。
