Create embedded template
The embedded template allows users to compose and create reusable templates on your website or mobile app using an iFrame, pop-up window, or a new tab. The process is similar to the embedded request, but it is used for template creation.
The templates created using the embedded template will be in the draft
state until the user completes the create process from the generated URL.
Create an embedded template link
post/v1/template/createEmbeddedTemplateUrlThe embedded template link is created in the same way as the regular template, but with additional properties to customize the embedded process. Please refer to the Create template for the create template API specific properties.
This API supports both multipart/form-data
and application/json
content types.
Asynchronous document processing
The template creation process is asynchronous in nature. You will receive an embedded request URL and template ID immediately, but the uploaded document might still be processing in the background. In the meantime, you can see the progress of the document processing by opening the embedded create template URL in the browser.
Request body
RedirectUrlstring | The redirect URI to be redirected after the template create process is completed. The string should be in URI format. |
ShowToolbarboolean | Controls the visibility of the toolbar at the top of the document editor. Defaults to false. |
ViewOptionstring | Configures the initial view page to be loaded from the generated URL. The FillingPage is used to customize roles, enforce authentication, etc. The PreparePage is used to configure form fields for the roles. Either PreparePage or FillingPage. Defaults to PreparePage. |
ShowSaveButtonboolean | Controls the visibility of the Defaults to true. |
ShowSendButtonboolean | Controls the visibility of the Defaults to true. |
ShowPreviewButtonboolean | Controls the visibility of the Defaults to true. |
AllowNewFilesboolean | When set to true, the sender can add new files while using this template to send signature requests. If set to false, the sender will not be able to add new files. Defaults to true. |
AllowModifyFilesboolean | When set to true, the sender can replace or delete existing files while using this template to send signature requests. If set to false, the sender will not have the ability to replace or delete files. Defaults to true. |
ShowNavigationButtonsboolean | Controls the visibility of the Defaults to true. |
LinkValidTillstring | Configures the expiration for the generated URL. A maximum of 180 days can be assigned. The string should be in date-time format. |
ShowTooltipboolean | To control the visibility of the Defaults to false. |
autoDetectFieldsboolean | When enabled, it will convert all the fillable form fields in the document to BoldSign form fields. BoldSign supports Textbox, Checkbox, Radio button, and Signature form fields. Other fields will not be detected as of now. Defaults to false. |
Example request using multipart/form-data
curl --location --request POST 'https://api.boldsign.com/v1/template/createEmbeddedTemplateUrl' \ --header 'X-API-KEY: ****YOUR-API-KEY****' \ --form 'Title=" API template"' \ --form 'Description=" API template description"' \ --form 'DocumentTitle=" API document title"' \ --form 'DocumentMessage=" API document message description"' \ --form 'AllowMessageEditing=" true"' \ --form 'Roles[0][name]="Manager"' \ --form 'Roles[0][index]="1"' \ --form 'ShowToolbar="true"' \ --form 'ShowSaveButton="true"' \ --form 'ShowSendButton="true"' \ --form 'ShowPreviewButton="true"' \ --form 'ShowNavigationButtons="true"' \ --form 'ShowTooltip="false"' \ --form 'ViewOption="PreparePage"' \ --form 'AllowNewFiles="true"' \ --form 'AllowModifyFiles="true"' \ --form 'Files=@"/docs/test-document.pdf"'
var apiClient = new ApiClient("YOUR_API_KEY"); var templateClient = new TemplateClient(apiClient); var templateRequest = new CreateEmbeddedTemplateRequest { Title = "Template created from API SDK", DocumentTitle = "API document title", Roles = [ new TemplateRole() { Index = 1, Name = "Manager" } ], Files = new List<IDocumentFile> { new DocumentFilePath { ContentType = "application/pdf", FilePath = "YOUR_FILE_PATH", }, }, ViewOption = PageViewOption.PreparePage, ShowToolbar = true, }; var templateCreated = templateClient.CreateEmbeddedTemplateUrl(templateRequest); var templateCreateUrl = templateCreated.CreateUrl;
import boldsign configuration = boldsign.Configuration(api_key="Your-API-KEY") with boldsign.ApiClient(configuration) as api_client: template_api = boldsign.TemplateApi(api_client) template_role = boldsign.TemplateRole( index=1, name="Manager") embedded_create_template_request = boldsign.EmbeddedCreateTemplateRequest ( title="API template", documentTitle="API document title", roles=[template_role], showToolbar=True, viewOption="FillingPage", files=["YOUR_FILE_PATH"]) template_created = template_api.create_embedded_template_url(embedded_create_template_request)
<?php require_once "vendor/autoload.php"; use BoldSign\Configuration; use BoldSign\Api\TemplateApi; use BoldSign\Model\{TemplateRole, EmbeddedCreateTemplateRequest, FileInfo}; $config = new Configuration(); $config->setApiKey('YOUR_API_KEY'); $template_api = new TemplateApi($config); $role = new TemplateRole(); $role->setIndex(1); $role->setName('Manager'); $embedded_create_template_request = new EmbeddedCreateTemplateRequest(); $embedded_create_template_request->setTitle('API template'); $embedded_create_template_request->setDocumentTitle('API document title'); $embedded_create_template_request->setRoles([$role]); $embedded_create_template_request->setShowToolbar(true); $embedded_create_template_request->setViewOption('PreparePage'); $files = new FileInfo(); $files = 'YOUR_FILE_PATH'; $embedded_create_template_request->setFiles([$files]); $template_created = $template_api->createEmbeddedTemplateUrl($embedded_create_template_request);
ApiClient client = Configuration.getDefaultApiClient(); client.setApiKey("YOUR_API_KEY"); TemplateApi templateApi = new TemplateApi(client); TemplateRole role = new TemplateRole(); role.setIndex(1); role.setName("Manager"); EmbeddedCreateTemplateRequest embeddedCreateTemplateRequest = new EmbeddedCreateTemplateRequest(); embeddedCreateTemplateRequest.setTitle("API template"); embeddedCreateTemplateRequest.setDocumentTitle("API document title"); embeddedCreateTemplateRequest.setRoles(Arrays.asList(role)); embeddedCreateTemplateRequest.setShowToolbar(true); embeddedCreateTemplateRequest.setViewOption(EmbeddedCreateTemplateRequest.ViewOptionEnum.PREPARE_PAGE); File file = new File("YOUR_FILE_PATH"); embeddedCreateTemplateRequest.setFiles(Arrays.asList(file)); EmbeddedTemplateCreated templateCreated = templateApi.createEmbeddedTemplateUrl(embeddedCreateTemplateRequest);
import { TemplateApi, TemplateRole, EmbeddedCreateTemplateRequest } from "boldsign"; import * as fs from 'fs'; const templateApi = new TemplateApi(); templateApi.setApiKey("YOUR_API_KEY"); const role = new TemplateRole(); role.index = 1; role.name = "Manager"; const files = fs.createReadStream("YOUR_FILE_PATH"); const embeddedCreateTemplateRequest = new EmbeddedCreateTemplateRequest(); embeddedCreateTemplateRequest.title = "Testing Embedded Template"; embeddedCreateTemplateRequest.documentTitle = "Embedded Template Test"; embeddedCreateTemplateRequest.showToolbar = true; embeddedCreateTemplateRequest.viewOption = EmbeddedCreateTemplateRequest.ViewOptionEnum.PreparePage; embeddedCreateTemplateRequest.roles = [role]; embeddedCreateTemplateRequest.files = [files]; const templateCreated = templateApi.createEmbeddedTemplateUrl(embeddedCreateTemplateRequest);
Example request using application/json
curl -X POST 'https://api.boldsign.com/v1/template/createEmbeddedTemplateUrl' \ -H 'X-API-KEY: ****YOUR-API-KEY****' \ -H 'Content-Type: application/json' \ -d '{ "Title": "API template", "Description": "API template description", "DocumentTitle": "API document title", "DocumentMessage": "API document message description", "AllowMessageEditing": true, "Roles": [ { "name": "Manager", "index": 1 } ], "ShowToolbar": true, "ShowSaveButton": true, "ShowSendButton": true, "ShowPreviewButton": true, "ShowNavigationButtons": true, "ShowTooltip": false, "ViewOption": "PreparePage", "Files": [ "data:application/pdf;base64,JVBERi0xLjcKJcfs..." ] }'
Example response
{ "templateId": "6a154b94...", "createUrl": "https://app.boldsign.com/document/embed/?templateId=6a154b94..." }