eSign.AIeSign.AI
Developer Center

Get the link to the create file template page

POST /esignglobal/v1/templates/create

API Description

Obtain the link to the file template creation page.

Developers can use this API to obtain a time-limited link to the file template creation page docTemplateCreateUrl, and open the link to allow operators to create a file template based on a specified file on the page.

Notes

  • fileKey is the file KEY obtained through the file upload API, used to specify the file on which this template creation is based.
  • docTemplateType defaults to 0, indicating a PDF template; pass in 2 indicates an HTML template, suitable for scenarios where table rows are dynamically added and populated.
  • Upon successful API call, returns docTemplateCreateUrl, the link is time-limited. It is recommended to use it immediately after retrieval, and long-term caching is not advised.
  • Developers can use redirectUrl to specify the redirect page after template creation is completed.

Request Parameters

Parameter Name

Type

Required

Description

docTemplateName

string

true

File template name, can be customized.

fileKey

string

true

File KEY, obtained via the file upload API.

docTemplateType

int

false

File template type, default value is 0

0: PDF template.

2: HTML template, suitable for scenarios where table rows are dynamically added and filled with content.

redirectUrl

string

false

Redirect link after template creation is completed, must be a valid URL.

Request Example

{
  "docTemplateName": "Sales Contract Template",
  "fileKey": "4150a67c-d4f0-45e6-88e9-541ce6d0c73c",
  "docTemplateType": 0,
  "redirectUrl": "https://example.com/template/create/callback"
}

Response Parameters

Parameter Name

Type

Description

code

int

Status code.

message

string

Response message.

data

object

Response data.

 

docTemplateId

string

ID of the newly created file template.

 

docTemplateCreateUrl

string

Link to the file template creation page, which is time-sensitive.

Response example

{
  "code": 0,
  "message": "success",
  "data": {
    "docTemplateId": "template_123456789",
    "docTemplateCreateUrl": "https://app.esignglobal.com/template/create?token=example"
  }
}