Create embedded template

The embedded template allows users to compose and create reusable templates on your website or mobile app using an iFrame, popup window or a new tab. The process is similar to the embedded request but it is used for template creation.

The templates created using embedded template will be in the draft state until the user completes the create process from the generated URL.

post/v1/template/createEmbeddedTemplateUrl

The embedded template link is created in the same way as the regular template, but with additional properties to customize the embedded process. Please refer 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 be still processing in the background. In the mean time, you can see the progress of the document processing by opening the embedded create template URL in the browser.

Request body

PropertyDescription
RedirectUrlstringThe 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.

LocalestringBy default, while opening the embedded request link, all the static contents available in the page will be loaded in the English language. This property is used to load the contents with different languages. The supported languages are EN(English), FR(French), NO(Norwegian), DE(German), ES(Spanish)

ShowSaveButtonboolean

Controls the visibility of the Save and Close button from the More Action drop down menu. Set to false if you don't want your users to save the template as a draft instead of finalizing the template.

Defaults to true.

ShowSendButtonboolean

Controls the visibility of the Create template button at the top right corner of the page. Set to false if you want your users to save the template as only drafts instead of finalizing the template.

Defaults to true.

ShowPreviewButtonboolean

Controls the visibility of the Preview button from the More Action drown down menu. Set to false if you don't want your users to preview the template before finalizing it.

Defaults to true.

ShowNavigationButtonsboolean

Controls the visibility of the Back button. Set to false if you don't want your users to navigate away from the current page.

Defaults to true.

LinkValidTillstringConfigures the expiration for the generated URL.A maximum of 180 days can be assigned. The string should be in date-time format.

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 'ViewOption="PreparePage"' \
     --form 'Locale="EN"' \
     --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,
    Locale = Locales.EN,
    ShowToolbar = true,
    ShowNavigationButtons = true,
    ShowSaveButton = true,
    ShowPreviewButton = false,
    ShowCreateButton = true,
};

var templateCreated = await this.templateApi.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',
'ViewOption': 'PreparePage',
'Locale': 'EN'}
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('ViewOption', ' PreparePage');
form.append('Locale', ' EN'); 
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..."
}