查询模板信息列表
1. 接口描述
接口请求域名: essbasic.tencentcloudapi.com 。
通过此接口(DescribeTemplates)查询该第三方平台子客企业在电子签拥有的有效模板,不包括第三方平台模板
默认接口请求频率限制: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 和 Agent.ProxyAppId 均必填。 |
TemplateId | 否 | String | 模板唯一标识,查询单个模板时使用 |
ContentType | 否 | Integer | 查询内容:0-模板列表及详情(默认),1-仅模板列表 |
Limit | 否 | Integer | 查询个数,默认20,最大100;在查询列表的时候有效 |
Offset | 否 | Integer | 查询偏移位置,默认0;在查询列表的时候有效 |
QueryAllComponents | 否 | Boolean | 是否返回所有组件信息。默认false,只返回发起方控件;true,返回所有签署方控件 |
TemplateName | 否 | String | 模糊搜索模板名称,最大长度200 |
Operator | 否 | UserInfo | 操作者的信息 |
WithPreviewUrl | 否 | Boolean | 是否获取模板预览链接 |
WithPdfUrl | 否 | Boolean | 是否获取模板的PDF文件链接- 第三方应用集成需要开启白名单时才能使用。 |
ChannelTemplateId | 否 | String | 模板ID |
3. 输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Templates | Array of TemplateInfo | 模板详情 |
TotalCount | Integer | 查询总数 |
Limit | Integer | 查询数量 |
Offset | Integer | 查询起始偏移 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
4. 示例
示例1 查询有效模板列表
查询有效模板列表
输入示例
POST / HTTP/1.1
Host: essbasic.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeTemplates
<公共请求参数>
{
"Agent": {
"ProxyAppId": "d2b****b66f954d7cc",
"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",
"SignComponents": [
{
"ComponentValue": "test",
"FileIndex": 0,
"OffsetX": 0.0,
"OffsetY": 0.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",
"DocumentId": "test"
}
],
"TemplateType": 0,
"IsPromoter": true,
"PreviewUrl": "test",
"Components": [
{
"ComponentValue": "test",
"FileIndex": 0,
"OffsetX": 0.0,
"OffsetY": 0.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",
"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",
"ProxyOrganizationId": "yDxHwUyKxxxBNLMLjthsmk"
},
"TemplateId": "yDR0JUUgygxxxxjESIpKDSkE9"
}
输出示例
{
"Response": {
"Templates": [
{
"TemplateId": "test",
"TemplateName": "test",
"Description": "test",
"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",
"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",
"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",
"ProxyOrganizationId": "yDxHwUyKQxxx4zjEBNLMLjthsmk"
},
"Limit": "2"
}
输出示例
{
"Response": {
"Templates": [
{
"TemplateId": "test",
"TemplateName": "test",
"Description": "test",
"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",
"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",
"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. 开发者资源
腾讯云 API 平台
腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。
API Inspector
用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。
SDK
云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。
- Tencent Cloud SDK 3.0 for Python
- Tencent Cloud SDK 3.0 for Java
- Tencent Cloud SDK 3.0 for PHP
- Tencent Cloud SDK 3.0 for Go
- Tencent Cloud SDK 3.0 for NodeJS
- Tencent Cloud SDK 3.0 for .NET
- Tencent Cloud SDK 3.0 for C++
- Tencent Cloud SDK 3.0 for Ruby
命令行工具
6. 错误码
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码。
错误码 | 描述 |
---|---|
FailedOperation | 操作失败。 |
InternalError | 内部错误。 |
InternalError.Api | 其他API错误。 |
InternalError.Db | 数据库错误。 |
InternalError.DbRead | 数据库读取失败。 |
InternalError.DependsApi | 依赖的其他api出错。 |
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 | 用户信息不存在。 |
UnauthorizedOperation | 未授权操作。 |
UnauthorizedOperation.NoPermissionFeature | 请升级到对应版本后即可使用该接口。 |