Create embedded request link from template

post/v1/template/createEmbeddedRequestUrl

Unlike the document embedded request, the template embedded request process is synchronous, and your generated URL will be immediately accessible with documents and form fields already processed.

Generating the embedded request link is same as the regular template send, but with additional properties to customize the embedded process. For detailed information on the template API specific properties, please refer to the Template send section article.

Example request

curl --location --request POST 'https://api.boldsign.com/v1/template/createEmbeddedRequestUrl?templateId=<template-id>' \
    --header 'X-API-KEY: <api-key>' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "redirectUrl": "https://yourapp.example/redirect",
        "showToolbar": true,
        "sendViewOption": "FillingPage",
        "showSaveButton": true,
        "showSendButton": true,
        "locale": "EN",
        "showPreviewButton": true,
        "showNavigationButtons": true,
        "showTooltip": false,
        "roleRemovalIndices": [1, 2]
    }

var apiClient = new ApiClient("https://api.boldsign.com", "Your-API-KEY");

var templateClient = new TemplateClient(apiClient);

// This is an example document id, add your own template id created from the web app upon usage.
var templateId = "0992eb79-ea24-4e95-887a-10aa82b30957";

var templateRequest = new EmbeddedTemplateRequest(
    templateId: templateId,
    title: "Document from Template",
    message: "This document description")
{
    // customize page options
    SendViewOption = PageViewOption.PreparePage,
    Locale = Locales.EN,
    ShowToolbar = true,
    ShowNavigationButtons = true,
    ShowSaveButton = true,
    ShowPreviewButton = true,
    ShowSendButton = true,
    ShowTooltip = false,
    RoleRemovalIndices = new [] {1, 2}
};

var documentCreated = await templateClient.CreateEmbeddedRequestUrlAsync(templateRequest);

// url to send the document from your web application
var sendUrl = documentCreated.SendUrl;
import boldsign

configuration = boldsign.Configuration(api_key="YOUR_API_KEY")

with boldsign.ApiClient(configuration) as api_client:
    
    template_api = boldsign.TemplateApi(api_client)
    form_fields = [
        boldsign.FormField(
            fieldType="Signature",
            page_number=1,
            bounds=boldsign.Rectangle( x=50, y=100, width=100, height=60)
        )
    ]

    role = boldsign.Role(
        roleIndex=2,
        signerRole="signer",
        signerName="Signer Name 1",
        signerEmail="signer1@boldsign.dev",
        formFields=form_fields
    )
    
    embedded_send_template_form_requests = boldsign.EmbeddedSendTemplateFormRequest(
        title="API template",
        documentTitle="API document title", 
        roles=[role],        
        showToolbar=True,
        sendViewOption="PreparePage",
        files=["YOUR_FILE_PATH"]
    )
    
    create_embedded_request_url_template_response = template_api.create_embedded_request_url_template(template_id="YOUR_TEMPLATE_ID", embedded_send_template_form_request=embedded_send_template_form_requests)
<?php require_once "vendor/autoload.php";

$config = new BoldSign\Configuration();
$config->setApiKey('YOUR_API_KEY');

$template_api = new BoldSign\Api\TemplateApi($config);
$form_fields = new BoldSign\Model\FormField();
$form_fields->setFieldType('Signature');
$form_fields->setPageNumber(1);
$bounds = new BoldSign\Model\Rectangle([50, 100, 100, 60]);
$form_fields->setBounds($bounds);

$role = new \BoldSign\Model\Role();
$role->setRoleIndex(2);
$role->setSignerRole('Signer');
$role->setSignerName('Signer Name 1');
$role->setSignerEmail('signer1@boldsign.dev');
$role->setFormFields([$form_fields]);

$embedded_send_template_form_request = new \BoldSign\Model\EmbeddedSendTemplateFormRequest();
$embedded_send_template_form_request->setTitle('API template');
$embedded_send_template_form_request->setSendViewOption('PreparePage');
$embedded_send_template_form_request->setShowToolbar(true);
$embedded_send_template_form_request->setRoles([$role]);
$embedded_send_template_form_request->setFiles(['YOUR_FILE_PATH']);

$create_embedded_request_url_template_response  = $template_api->createEmbeddedRequestUrlTemplate($template_id = 'YOUR_TEMPLATE_ID', $embedded_send_template_form_request);
ApiClient client = Configuration.getDefaultApiClient();  
client.setApiKey("YOUR_API_KEY");
        
TemplateApi templateApi = new TemplateApi(client);
FormField signatureField = new FormField();
signatureField.setFieldType(FormField.FieldTypeEnum.SIGNATURE);
signatureField.setPageNumber(1);
Rectangle bounds = new Rectangle();
bounds.setX(50f);
bounds.setY(100f);
bounds.setWidth(100f);
bounds.setHeight(60f);
signatureField.setBounds(bounds);

Role role = new Role();
role.setRoleIndex(1);
role.setSignerName("Signer Name 1");
role.setSignerEmail("signer1@boldsign.dev");
role.setSignerRole("Signer");
role.setFormFields(Arrays.asList(signatureField));

EmbeddedSendTemplateFormRequest embeddedSendTemplateFormRequest = new EmbeddedSendTemplateFormRequest();
embeddedSendTemplateFormRequest.setTitle("API template");
embeddedSendTemplateFormRequest.setRoles(Arrays.asList(role));
embeddedSendTemplateFormRequest.setShowToolbar(true);
embeddedSendTemplateFormRequest.setSendViewOption(EmbeddedSendTemplateFormRequest.SendViewOptionEnum.PREPARE_PAGE);
File file = new File("YOUR_FILE_PATH");
embeddedSendTemplateFormRequest.setFiles(Arrays.asList(file));

EmbeddedSendCreated createEmbeddedRequestUrlTemplateResponse = templateApi.createEmbeddedRequestUrlTemplate("YOUR_TEMPLATE_ID", embeddedSendTemplateFormRequest);
import { TemplateApi, EmbeddedSendTemplateFormRequest, Role } from "boldsign";
import * as fs from 'fs';

const templateApi = new TemplateApi();
templateApi.setApiKey("YOUR_API_KEY");

const role = new Role();
role.roleIndex = 1;
role.signerName = "Signer Name 1";
role.signerEmail = "signer1@boldsign.dev";
role.signerRole = "Signer";

const files = fs.createReadStream("YOUR_FILE_PATH");

const embeddedSendTemplateFormRequest = new EmbeddedSendTemplateFormRequest();
embeddedSendTemplateFormRequest.title = "Api template";
embeddedSendTemplateFormRequest.roles = [role];
embeddedSendTemplateFormRequest.showToolbar = true;
embeddedSendTemplateFormRequest.sendViewOption = EmbeddedSendTemplateFormRequest.SendViewOptionEnum.FillingPage;
embeddedSendTemplateFormRequest.files = [files];

const embeddedTemplateUrlResponse = templateApi.createEmbeddedRequestUrlTemplate("YOUR_TEMPLATE_ID", embeddedSendTemplateFormRequest);

Query parameters

templateIdstringRequiredThe ID of the existing template to be used for sending the template.

Request body

RedirectUrlstringThe redirect URI will be redirected after the template creation process is complete. The string should be in URI format.
ShowToolbarbooleanControls the visibility of the toolbar at the top of the template editor.
Defaults to false.
SendViewOptionstringConfigures the initial view page to be loaded from the generated URL. The FillingPage is used to customize signers, authentication etc. The PreparePage is used to configure signers form fields.
Either PreparePage or FillingPage. Defaults to PreparePage.
ShowSaveButtonbooleanControls 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 draft instead of sending it out for signature.
Defaults to true.
ShowSendButtonbooleanControls the visibility of the Send 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 sending it out for signature.
Defaults to true.
ShowPreviewButtonbooleanControls the visibility of the Preview button from the More Action drop down menu. Set to false if you don't want your users to preview the template before sending it out for signature.
Defaults to true.
ShowNavigationButtonsbooleanControls 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.
SendLinkValidTillstringConfigures the expiration for the generated URL. A maximum of 180 days can be assigned. The String should be in date-time format.
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), BG(Bulgarian), CS(Czech), DA(Danish), IT(Italian), NL(Dutch), PL(Polish), PT(Portuguese), RO(Romanian), RU(Russian), SV(Swedish)
ShowTooltipbooleanTo control the visibility of the Tooltip near the assignee field on the prepare page, set it to "true" if you want to show the tooltip to the user. Defaults to false.

Example response

{
    "documentId": "625cff3d...",
    "sendUrl": "https://app.boldsign.com/document/embed/?documentId=625cff3d..."
}