# Create Embedded Request Link from Template

{% post /%}
{% path text="/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 {% customlink href="/template/create-template/" text="Template send section" /%} article.

## Example request
 
{% codetab %}

cURL

```shell
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": "FillingPage",
        "ShowSaveButton": true,
        "ShowSendButton": true,
        "Locale": "EN",
        "ShowPreviewButton": true,
        "ShowNavigationButtons": true,
        "ShowTooltip": false,
        "RoleRemovalIndices": [1, 2]
    }
```

C#

```csharp
var apiClient = new ApiClient("https://api.boldsign.com", "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,
    ShowToolbar = true
};

var embeddedSendCreated = templateClient.CreateEmbeddedRequestUrl(templateRequest);
var sendUrl = embeddedSendCreated.SendUrl;
```

Python

```python
import boldsign

configuration = boldsign.Configuration(host = "https://api.boldsign.com", 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,
        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
<?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->setRoles([$role]);

$embedded_send_created = $template_api->createEmbeddedRequestUrlTemplate($template_id = 'YOUR_TEMPLATE_ID', $embedded_send_template_form_request);
```

Java

```java
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
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.setSendViewOption(EmbeddedSendTemplateFormRequest.SendViewOptionEnum.PREPARE_PAGE);

EmbeddedSendCreated embeddedSendCreated = templateApi.createEmbeddedRequestUrlTemplate("YOUR_TEMPLATE_ID", embeddedSendTemplateFormRequest);
```

NodeJS

```js
import { TemplateApi, EmbeddedSendTemplateFormRequest, Role } from "boldsign";
import * as fs from 'fs';

const templateApi = new TemplateApi("https://api.boldsign.com");
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 embeddedSendTemplateFormRequest = new EmbeddedSendTemplateFormRequest();
embeddedSendTemplateFormRequest.roles = [role];
embeddedSendTemplateFormRequest.showToolbar = true;
embeddedSendTemplateFormRequest.sendViewOption = EmbeddedSendTemplateFormRequest.SendViewOptionEnum.FillingPage;

const embeddedSendCreated = templateApi.createEmbeddedRequestUrlTemplate("YOUR_TEMPLATE_ID", embeddedSendTemplateFormRequest);
```

{% /codetab %}

## Query parameters
{% nestedtable %}
- {% arguments name="templateId" /%}{% batch datatype="string" /%}{% required /%}
- The ID of the existing template to be used for sending the template.
{% /nestedtable %}

## Request body

{% nestedtable %}
- {% arguments name="RedirectUrl" /%}{% batch datatype="string" /%}
- The redirect URI will be redirected after the template creation process is complete. The string should be in URI format.
---
- {% arguments name="ShowToolbar" /%}{% batch datatype="boolean" /%}
- Controls the visibility of the toolbar at the top of the template editor.  
  Defaults to false.
---
- {% arguments name="SendViewOption" /%}{% batch datatype="string" /%}
- Configures 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.
---
- {% arguments name="ShowSaveButton" /%}{% batch datatype="boolean" /%}
- 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 draft instead of sending it out for signature.  
  Defaults to true.

---

- {% arguments name="ShowSendButton" /%}{% batch datatype="boolean" /%}
- Controls 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.

---

- {% arguments name="ShowPreviewButton" /%}{% batch datatype="boolean" /%}
- Controls 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.
---
- {% arguments name="ShowNavigationButtons" /%}{% batch datatype="boolean" /%}
- 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.

---

- {% arguments name="SendLinkValidTill" /%}{% batch datatype="string" /%}
- Configures the expiration for the generated URL. A maximum of 180 days can be assigned. The String should be in date-time format.

---

- {% arguments name="Locale" /%}{% batch datatype="string" /%}
- By 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)

---

- {% arguments name="ShowTooltip" /%}{% batch datatype="boolean" /%}
- To 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.

---

- {% arguments name="AllowScheduledSend" /%}{% batch datatype="boolean" /%}
- This property enables or disables the scheduling option. When enabled, it allows scheduling the document for future sending. The default value is `false`.

{% /nestedtable %}

## Example response

```json
{
    "documentId": "625cff3d...",
    "sendUrl": "https://app.boldsign.com/document/embed/?documentId=625cff3d..."
}
```
