查询模板信息列表
1. 接口描述
接口请求域名: essbasic.tencentcloudapi.com 。
通过此接口(DescribeTemplates)查询该第三方平台子客企业在电子签拥有的有效模板,不包括第三方平台模板。
适用场景
该接口常用来配合“使用模板创建签署流程”接口作为前置的接口使用。 一个模板通常会包含以下结构信息
- 模板基本信息
- 发起方参与信息Promoter、签署参与方 Recipients,后者会在模板发起合同时用于指定参与方
- 填写控件 Components
- 签署控件 SignComponents
- 生成模板的文件基础信息 FileInfos
默认接口请求频率限制:20次/秒。
推荐使用 API Explorer
点击调试API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。
2. 输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数。
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeTemplates。 |
Version | 是 | String | 公共参数,本接口取值:2021-05-26。 |
Region | 否 | String | 公共参数,此参数为可选参数。 |
Agent | 是 | Agent | 应用相关信息。 此接口Agent.ProxyOrganizationOpenId、Agent. ProxyOperator.OpenId、Agent.AppId必填。 |
TemplateId | 否 | String | 模板唯一标识,查询单个模板时使用 |
ContentType | 否 | Integer | 查询内容: 0-模板列表及详情(默认), 1-仅模板列表 |
Limit | 否 | Integer | 指定每页多少条数据,如果不传默认为20,单页最大100。 |
Offset | 否 | Integer | 查询结果分页返回,此处指定第几页,如果不传默从第一页返回。页码从0开始,即首页为0。 |
QueryAllComponents | 否 | Boolean | 是否返回所有组件信息。 默认false,只返回发起方控件; true,返回所有签署方控件 |
TemplateName | 否 | String | 模糊搜索模板名称,最大长度200 |
WithPreviewUrl | 否 | Boolean | 是否获取模板预览链接, 默认false-不获取 true-获取 |
WithPdfUrl | 否 | Boolean | 是否获取模板的PDF文件链接。 默认false-不获取 true-获取 请联系客户经理开白后使用。 |
ChannelTemplateId | 否 | String | 对应第三方应用平台企业的模板ID |
3. 输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Templates | Array of TemplateInfo | 模板列表 |
TotalCount | Integer | 查询到的总数 |
Limit | Integer | 每页多少条数据 |
Offset | Integer | 查询结果分页返回,此处指定第几页。页码从0开始,即首页为0。 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
4. 示例
示例1 查询有效模板列表
查询有效模板列表
输入示例
POST / HTTP/1.1
Host: essbasic.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeTemplates
<公共请求参数>
{
"Agent": {
"ProxyOrganizationOpenId": "yDxAyUyK****cb7u0jQn0Zh7f7",
"ProxyOperator": {
"OpenId": "732aaef****541b89c49e0cc"
},
"AppId": "ed68bc6***********0214e4e"
},
"TemplateId": "templated_test_id",
"ContentType": 1,
"Offset": 0,
"Limit": 2
}
输出示例
{
"Response": {
"Templates": [
{
"ChannelAutoSave": 0,
"PdfUrl": "test",
"Description": "test",
"Recipients": [
{
"RecipientType": "test",
"Description": "test",
"RoutingOrder": 0,
"SignType": 0,
"RecipientId": "test",
"IsPromoter": true,
"RequireValidation": true,
"RoleName": "test",
"RequireSign": true
}
],
"TemplateName": "test",
"CreatedOn": 1234567890,
"Creator": "test",
"ChannelTemplateName": "test",
"Available": 2,
"SignComponents": [
{
"ComponentValue": "test",
"FileIndex": 0,
"OffsetX": 0,
"OffsetY": 0,
"ComponentType": "test",
"ComponentPosX": 1241.15,
"ComponentPosY": 125.12,
"GenerateMode": "test",
"KeywordIndexes": [
0
],
"ComponentDateFontSize": 0,
"RelativeLocation": "test",
"ComponentHeight": 12.142,
"ComponentDescription": "test",
"ComponentRequired": true,
"ComponentId": "test",
"ComponentRecipientId": "test",
"KeywordPage": 0,
"ComponentWidth": 1.1,
"ComponentName": "test",
"ChannelComponentId": "test",
"ComponentExtra": "test",
"ComponentPage": 1,
"KeywordOrder": "test",
"Placeholder": "",
"DocumentId": "test"
}
],
"TemplateType": 0,
"IsPromoter": true,
"PreviewUrl": "test",
"Components": [
{
"ComponentValue": "test",
"FileIndex": 0,
"OffsetX": 0,
"OffsetY": 0,
"ComponentType": "test",
"ComponentPosX": 1241.15,
"ComponentPosY": 125.12,
"GenerateMode": "test",
"KeywordIndexes": [
0
],
"ComponentDateFontSize": 0,
"RelativeLocation": "test",
"ComponentHeight": 12.142,
"ComponentDescription": "test",
"ComponentRequired": true,
"ComponentId": "test",
"ComponentRecipientId": "test",
"KeywordPage": 0,
"ComponentWidth": 1.1,
"ComponentName": "test",
"ChannelComponentId": "test",
"ComponentExtra": "test",
"ComponentPage": 1,
"KeywordOrder": "test",
"Placeholder": "",
"DocumentId": "test"
}
],
"TemplateId": "test",
"TemplateVersion": "test",
"ChannelTemplateId": "test"
}
],
"TotalCount": 1,
"Limit": 1,
"RequestId": "test",
"Offset": 1
}
}
示例2 返回所有component
返回所有component
输入示例
POST / HTTP/1.1
Host: essbasic.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeTemplates
<公共请求参数>
{
"QueryAllComponents": "true",
"Agent": {
"ProxyOperator": {
"OpenId": "test1xxxxx_test1"
},
"AppId": "7f3497fxxx35e0984a9657b0ec",
"ProxyOrganizationOpenId": "test1_clarxxxnization1"
},
"TemplateId": "yDR0JUUgygxxxxjESIpKDSkE9"
}
输出示例
{
"Response": {
"Templates": [
{
"TemplateId": "test",
"TemplateName": "test",
"Description": "test",
"Available": 2,
"Components": [
{
"ComponentId": "test",
"ComponentType": "test",
"ComponentName": "test",
"ComponentRequired": true,
"ComponentRecipientId": "test",
"FileIndex": 0,
"GenerateMode": "test",
"ComponentWidth": 0,
"ComponentHeight": 0,
"ComponentPage": 0,
"ComponentPosX": 0,
"ComponentPosY": 0,
"ComponentExtra": "test",
"ComponentValue": "test",
"ComponentDateFontSize": 0,
"DocumentId": "test",
"ComponentDescription": "test",
"OffsetX": 0,
"OffsetY": 0,
"ChannelComponentId": "test",
"KeywordOrder": "test",
"KeywordPage": 0,
"RelativeLocation": "test",
"Placeholder": "",
"KeywordIndexes": [
0
]
}
],
"Recipients": [
{
"RecipientId": "test",
"RecipientType": "test",
"Description": "test",
"RoleName": "test",
"RequireValidation": true,
"RequireSign": true,
"SignType": 0,
"RoutingOrder": 0,
"IsPromoter": true
}
],
"SignComponents": [
{
"ComponentId": "test",
"ComponentType": "test",
"ComponentName": "test",
"ComponentRequired": true,
"ComponentRecipientId": "test",
"FileIndex": 0,
"GenerateMode": "test",
"ComponentWidth": 0,
"ComponentHeight": 0,
"ComponentPage": 0,
"ComponentPosX": 0,
"ComponentPosY": 0,
"ComponentExtra": "test",
"ComponentValue": "test",
"ComponentDateFontSize": 0,
"DocumentId": "test",
"ComponentDescription": "test",
"OffsetX": 0,
"OffsetY": 0,
"ChannelComponentId": "test",
"KeywordOrder": "test",
"KeywordPage": 0,
"RelativeLocation": "test",
"Placeholder": "",
"KeywordIndexes": [
0
]
}
],
"TemplateType": 0,
"IsPromoter": true,
"Creator": "test",
"CreatedOn": 0,
"PreviewUrl": "test",
"PdfUrl": "test",
"ChannelTemplateId": "test",
"ChannelTemplateName": "test",
"ChannelAutoSave": 0,
"TemplateVersion": "test"
}
],
"TotalCount": 0,
"Limit": 1,
"Offset": 1,
"RequestId": "test"
}
}
示例3 模糊搜索模板名
模糊搜索模板名
输入示例
POST / HTTP/1.1
Host: essbasic.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeTemplates
<公共请求参数>
{
"TemplateName": "顺序签署",
"QueryAllComponents": "true",
"Agent": {
"ProxyOperator": {
"OpenId": "test1xxxa_test1"
},
"AppId": "7f3497f015xxxxe0984a9657b0ec",
"ProxyOrganizationOpenId": "test1_claraxxxanization1"
},
"Limit": "2"
}
输出示例
{
"Response": {
"Templates": [
{
"TemplateId": "test",
"TemplateName": "test",
"Description": "test",
"Available": 2,
"Components": [
{
"ComponentId": "test",
"ComponentType": "test",
"ComponentName": "test",
"ComponentRequired": true,
"ComponentRecipientId": "test",
"FileIndex": 0,
"GenerateMode": "test",
"ComponentWidth": 0,
"ComponentHeight": 0,
"ComponentPage": 0,
"ComponentPosX": 0,
"ComponentPosY": 0,
"ComponentExtra": "test",
"ComponentValue": "test",
"ComponentDateFontSize": 0,
"DocumentId": "test",
"ComponentDescription": "test",
"OffsetX": 0,
"OffsetY": 0,
"ChannelComponentId": "test",
"KeywordOrder": "test",
"KeywordPage": 0,
"RelativeLocation": "test",
"Placeholder": "",
"KeywordIndexes": [
0
]
}
],
"Recipients": [
{
"RecipientId": "test",
"RecipientType": "test",
"Description": "test",
"RoleName": "test",
"RequireValidation": true,
"RequireSign": true,
"SignType": 0,
"RoutingOrder": 0,
"IsPromoter": true
}
],
"SignComponents": [
{
"ComponentId": "test",
"ComponentType": "test",
"ComponentName": "test",
"ComponentRequired": true,
"ComponentRecipientId": "test",
"FileIndex": 0,
"GenerateMode": "test",
"ComponentWidth": 0,
"ComponentHeight": 0,
"ComponentPage": 0,
"ComponentPosX": 0,
"ComponentPosY": 0,
"ComponentExtra": "test",
"ComponentValue": "test",
"ComponentDateFontSize": 0,
"DocumentId": "test",
"ComponentDescription": "test",
"OffsetX": 0,
"OffsetY": 0,
"ChannelComponentId": "test",
"KeywordOrder": "test",
"KeywordPage": 0,
"RelativeLocation": "test",
"Placeholder": "",
"KeywordIndexes": [
0
]
}
],
"TemplateType": 0,
"IsPromoter": true,
"Creator": "test",
"CreatedOn": 0,
"PreviewUrl": "test",
"PdfUrl": "test",
"ChannelTemplateId": "test",
"ChannelTemplateName": "test",
"ChannelAutoSave": 0,
"TemplateVersion": "test"
}
],
"TotalCount": 0,
"Limit": 1,
"Offset": 1,
"RequestId": "test"
}
}
5. 错误码
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码。
错误码 | 描述 |
---|---|
FailedOperation | 操作失败。 |
InternalError | 内部错误。 |
InternalError.System | 系统错误。 |
InvalidParameter | 参数错误。 |
InvalidParameter.Application | 应用号不存在。 |
InvalidParameter.ContentType | 查询内容参数有误。 |
InvalidParameter.DataNotFound | 数据不存在。 |
InvalidParameter.ParamError | 参数错误。 |
InvalidParameterValue | 参数取值错误。 |
MissingParameter | 缺少参数错误。 |
OperationDenied | 操作被拒绝。 |
OperationDenied.NoIdentityVerify | 未通过个人实名。 |
OperationDenied.UserNotInOrganization | 用户不归属于当前企业,无法操作,请检查后重试。 |
ResourceNotFound | 资源不存在。 |
ResourceNotFound.Application | 应用号不存在。 |
ResourceNotFound.Resource | 资源不存在。 |
ResourceNotFound.Template | 模板不存在。 |
ResourceNotFound.User | 用户信息不存在。 |
ResourceUnavailable | 资源不可用。 |
UnauthorizedOperation | 未授权操作。 |
UnauthorizedOperation.NoPermissionFeature | 请升级到对应版本后即可使用该接口。 |