Articles in this section
Category / Section

How to create embedded request link from template to show the prepare page?

Published:
3 mins read

In BoldSign, when creating an embedded request link from a template, you can configure the request link to keep the sender on the configure fields page, bypassing the need to navigate back to the document and signer details page. To achieve this, set the ShowNavigationButtons to false and ensure that the SendViewOption is set to PreparePage when generating the embedded send link.
Below are code snippets to demonstrate this:
Curl

curl -X POST 'https://api.boldsign.com/v1/template/createEmbeddedRequestUrl?templateId=<template-id>' \
    -H 'X-API-KEY: <api-key>' \
    -H 'Content-Type: application/json' \
    -d '{
        "RedirectUrl": "https://yourapp.example/redirect",
        "ShowToolbar": true,
        "SendViewOption": "PreparePage",
        "ShowSaveButton": true,
        "ShowSendButton": true,
        "Locale": "EN",
        "ShowPreviewButton": true,
        "ShowNavigationButtons": false,    
    }
   

.Net

var apiClient = new ApiClient("YOUR_API_KEY");

var templateClient = new TemplateClient(apiClient);

var templateRequest = new EmbeddedTemplateRequest()
{
    TemplateId = "YOUR_TEMPLATE_ID",
    Roles = 
    [
        new Roles()
        {
            RoleIndex = 1,
            SignerName = "David",
            SignerEmail = "david@cubeflakes.com",
            SignerType = SignerType.Signer
        }
    ],
    SendViewOption = PageViewOption.PreparePage,
    ShowNavigationButtons= false,
    ShowSendButton= true, 
    ShowToolbar = true
};

var embeddedSendCreated = templateClient.CreateEmbeddedRequestUrl(templateRequest);
var sendUrl = embeddedSendCreated.SendUrl;

Python

import boldsign

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

with boldsign.ApiClient(configuration) as api_client:
    
    template_api = boldsign.TemplateApi(api_client)
    
    role = boldsign.Role(
        roleIndex=1,
        signerRole="signer",
        signerName="Signer Name 1",
        signerEmail="signer1@boldsign.dev")
    
    embedded_send_template_form_request = boldsign.EmbeddedSendTemplateFormRequest(
        roles=[role],        
        showToolbar=True,
        ShowNavigationButtons= false,
        ShowSendButton= true,
        sendViewOption="PreparePage")
    
    embedded_send_created = template_api.create_embedded_request_url_template(template_id="YOUR_TEMPLATE_ID", embedded_send_template_form_request=embedded_send_template_form_request)

PHP

<?php require_once "vendor/autoload.php";

use BoldSign\Configuration;
use BoldSign\Api\TemplateApi;
use BoldSign\Model\{Role, EmbeddedSendTemplateFormRequest};

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

$template_api = new TemplateApi($config);

$role = new Role();
$role->setRoleIndex(1);
$role->setSignerRole('Signer');
$role->setSignerName('Signer Name 1');
$role->setSignerEmail('signer1@boldsign.dev');

$embedded_send_template_form_request = new EmbeddedSendTemplateFormRequest();
$embedded_send_template_form_request->setSendViewOption('PreparePage');
$embedded_send_template_form_request->setShowToolbar(true);
$embedded_send_template_form_request->setShowNavigationButtons(false);
$embedded_send_template_form_request->setRoles([$role]);

$embedded_send_created = $template_api->createEmbeddedRequestUrlTemplate($template_id = 'YOUR_TEMPLATE_ID', $embedded_send_template_form_request);

Java

ApiClient client = Configuration.getDefaultApiClient();  
client.setApiKey("YOUR_API_KEY");
        
TemplateApi templateApi = new TemplateApi(client);

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

EmbeddedSendTemplateFormRequest embeddedSendTemplateFormRequest = new EmbeddedSendTemplateFormRequest();
embeddedSendTemplateFormRequest.setRoles(Arrays.asList(role));
embeddedSendTemplateFormRequest.setShowToolbar(true);
embeddedSendTemplateFormRequest.setShowNavigationButtons(false);
embeddedSendTemplateFormRequest.setSendViewOption(EmbeddedSendTemplateFormRequest.SendViewOptionEnum.PREPARE_PAGE);

EmbeddedSendCreated embeddedSendCreated = templateApi.createEmbeddedRequestUrlTemplate("YOUR_TEMPLATE_ID", embeddedSendTemplateFormRequest);

Node.js

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 = "stevesam@cubeflakes.com";
role.signerRole = "Signer";

const embeddedSendTemplateFormRequest = new EmbeddedSendTemplateFormRequest();
embeddedSendTemplateFormRequest.roles = [role];
embeddedSendTemplateFormRequest.showToolbar = true;
embeddedSendTemplateFormRequest.showNavigationButtons = false;
embeddedSendTemplateFormRequest.sendViewOption = EmbeddedSendTemplateFormRequest.SendViewOptionEnum.PreparePage;

(async () => {
  try {
    const embeddedSendCreated = await templateApi.createEmbeddedRequestUrlTemplate(
      "Your template Id",
      embeddedSendTemplateFormRequest
    );
    console.log("Embedded URL:", embeddedSendCreated);
  } catch (error) {
    console.error("Error:", error.response?.data || error);
  }
})();

In the above code examples, set showNavigationButtons to false and ensure that sendViewOption is set to PreparePage when generating the embedded send link. This configuration directs the sender straight to the Prepare Page, allowing them to configure form fields without navigating back to the document or signer details page.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Access denied
Access denied