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.
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. |
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. |
Example request
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 'Files=@"/docs/test-document.pdf"'
var apiClient = new ApiClient("https://api.boldsign.com", "Your-API-KEY"); var templateClient = new TemplateClient(apiClient); var templateRequest = new CreateEmbeddedTemplateRequest { Title = "Template created from API SDK", Description = "The is a template created to get a quick contract sign.", DocumentTitle = "Sent using template created from API SDK", DocumentMessage = "This is document message sent from API SDK", AllowMessageEditing = true, EnableSigningOrder = true, Roles = new List<TemplateRole> { new TemplateRole(index: 1, name: "Manager"), }, Files = new List<IDocumentFile> { new DocumentFileStream { ContentType = "application/pdf", FileData = fileStream, FileName = "NDA1.pdf", }, new DocumentFileBytes() { ContentType = "application/pdf", FileData = fileByteArray, FileName = "NDA2.pdf", }, new DocumentFilePath { ContentType = "application/pdf", // directly provide file path FilePath = "NDA3.pdf", }, }, // customize page options ViewOption = PageViewOption.PreparePage, ShowToolbar = true, ShowNavigationButtons = true, ShowSaveButton = true, ShowPreviewButton = false, ShowCreateButton = true, ShowTooltip = false, }; var templateCreated = await templateClient.CreateEmbeddedTemplateUrlAsync(templateRequest); // url to send the document from your web application var templateCreateUrl = templateCreated.CreateUrl;
import requests url = "https://api.boldsign.com/v1/template/createEmbeddedTemplateUrl" payload={'Title': ' API template', 'Description': ' API template description', 'DocumentTitle': ' API document title', 'DocumentMessage': ' API document message description', 'AllowMessageEditing': ' true', 'Roles[0][name]': 'Manager', 'Roles[0][index]': '1', 'ShowToolbar': 'true', 'ShowSaveButton': 'true', 'ShowSendButton': 'true', 'ShowPreviewButton': 'true', 'ShowNavigationButtons': 'true', 'ShowTooltip': 'false', 'ViewOption': 'PreparePage'} files=[ ('Files',('file',open('{file path}','rb'),'application/octet-stream')) ] headers = { 'X-API-KEY': '****YOUR-API-KEY****' } response = requests.request("POST", url, headers=headers, data=payload, files=files) print(response.text)
const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); const form = new FormData(); form.append('Title', ' API template'); form.append('Description', ' API template description'); form.append('DocumentTitle', ' API document title'); form.append('DocumentMessage', ' API document message description'); form.append('AllowMessageEditing', ' true'); form.append('Roles[0][name]', ' Manager'); form.append('Roles[0][index]', ' 1'); form.append('ShowToolbar', ' true'); form.append('ShowSaveButton', ' true'); form.append('ShowSendButton', ' true'); form.append('ShowPreviewButton', ' true'); form.append('ShowNavigationButtons', ' true'); form.append('ShowTooltip', 'false'); form.append('ViewOption', ' PreparePage'); form.append('Files', fs.readFileSync('/docs/test-document.pdf'), '/docs/test-document.pdf'); const response = await axios.post( ' https://api.boldsign.com/v1/template/createEmbeddedTemplateUrl', form, { headers: { ...form.getHeaders(), 'X-API-KEY': '****YOUR-API-KEY****' } } );
Example response
{ "templateId": "6a154b94...", "createUrl": "https://app.boldsign.com/document/embed/?templateId=6a154b94..." }