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",
        description="API template description",
        documentTitle="API document title",
        documentMessage="API document message description",
        allowMessageEditing=True,    
        roles=[role],        
        showToolbar=True,
        showNavigationButtons=True,
        showPreviewButton=True,
        showSendButton=True,
        showSaveButton=True,
        sendViewOption="PreparePage",
        locale="EN",
        showTooltip=False,
        enableSigningOrder=False,
        roleRemovalIndices=[1, 2],
        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
    )
const axios = require('axios'); 
const response = await axios.post( 

    ' https://api.boldsign.com/v1/template/createEmbeddedRequestUrl', 
    { 
        'redirectUrl': ' https://yourapp.example/redirect', 
        'showToolbar': true, 
        'sendViewOption': 'FillingPage',
        'locale': 'EN',
        'showSaveButton': true, 
        'showSendButton': true, 
        'showPreviewButton': true, 
        'showNavigationButtons': true, 
        'showTooltip': false,
        'roles': [ 

            { 
                'roleIndex': 1, 
                'signerName': 'Signer Name 1', 
                'signerEmail': 'signer@boldsign.dev', 
                'role': 'Manager' 
            } 
        ],
        'roleRemovalIndices': [1, 2]
    }, 

    { 
        params: { 
            'templateId': '<template-id>' 
        }, 

        headers: { 
            'X-API-KEY': '<api-key>', 
            'Content-Type': 'application/json' 
        } 
    } 
); 

Example response

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