# Edit embedded template

The embedded template edit link allows users to edit already created templates on your website or mobile app using an iFrame, pop-up window, or a new tab.

## Get embedded template edit link

{% post /%}
{% path text="/v1/template/getEmbeddedTemplateEditUrl" /%}

The get embedded template edit link has additional properties to customize the embedded process.

### Code snippet

{% codetab %}

cURL

```shell
curl -X 'POST' \
  'https://api.boldsign.com/v1/template/getEmbeddedTemplateEditUrl?templateId=be5cbb00-xxxx-xxxx-xxxx-bafa580exxxx' \
  -H 'accept: application/json' \
  -H 'X-API-KEY: {your API Key}' \
  -H 'Content-Type: multipart/form-data' \ 
  -F 'ShowToolbar=false' \
  -F 'ViewOption=PreparePage' \
  -F 'ShowSaveButton=true' \
  -F 'ShowCreateButton=true' \
  -F 'ShowPreviewButton=true' \
  -F 'ShowNavigationButtons=true' \
  -F 'ShowTooltip=false' \
```

C#

```csharp
var apiClient = new ApiClient("https://api.boldsign.com", "Your_API_Key");

var templateClient = new TemplateClient(apiClient);

var embeddedTemplateEditRequest = new EmbeddedTemplateEditRequest()
{
    TemplateId = "YOUR_TEMPLATE_ID",
    ViewOption = PageViewOption.FillingPage,
    ShowToolbar = true,
    ShowPreviewButton = false,
};

var embeddedTemplateEdited = templateClient.GetEmbeddedTemplateEditUrl(embeddedTemplateEditRequest);
var templateEditUrl = embeddedTemplateEdited.EditUrl;
```

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)
	
    embedded_template_edit_request = boldsign.EmbeddedTemplateEditRequest(
        viewOption="PreparePage",
        showPreviewButton=False,
        showToolbar=True)
           
    embedded_template_edited = template_api.get_embedded_template_edit_url(template_id= "YOUR_TEMPLATE_ID", embedded_template_edit_request=embedded_template_edit_request)
```

PHP

```php
<?php require_once "vendor/autoload.php";

use BoldSign\Configuration;
use BoldSign\Api\TemplateApi;
use BoldSign\Model\EmbeddedTemplateEditRequest;

$config = new Configuration();
$config->setHost('https://api.boldsign.com');
$config->setApiKey('YOUR_API_KEY');

$template_api = new TemplateApi($config);

$embedded_template_edit_request = new EmbeddedTemplateEditRequest();
$embedded_template_edit_request->setShowToolbar(true);
$embedded_template_edit_request->setShowPreviewButton(false);
$embedded_template_edit_request->setViewOption('PreparePage');

$embedded_template_edited = $template_api->getEmbeddedTemplateEditUrl($template_id = 'YOUR_TEMPLATE_ID', $embedded_template_edit_request);
```

Java

```java
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");
            
TemplateApi templateApi = new TemplateApi(client);

EmbeddedTemplateEditRequest embeddedTemplateEditRequest = new EmbeddedTemplateEditRequest();
embeddedTemplateEditRequest.setShowToolbar(true);
embeddedTemplateEditRequest.setShowPreviewButton(false);
embeddedTemplateEditRequest.setViewOption(EmbeddedTemplateEditRequest.ViewOptionEnum.PREPARE_PAGE);

EmbeddedTemplateEdited embeddedTemplateEdited = templateApi.getEmbeddedTemplateEditUrl("YOUR_TEMPLATE_ID", embeddedTemplateEditRequest);
```

NodeJS

```js
import { TemplateApi, EmbeddedTemplateEditRequest } from "boldsign";

const templateApi = new TemplateApi("https://api.boldsign.com");
templateApi.setApiKey("YOUR_API_KEY");

const embeddedTemplateEditRequest = new EmbeddedTemplateEditRequest();
embeddedTemplateEditRequest.showToolbar = true;
embeddedTemplateEditRequest.showPreviewButton = false;
embeddedTemplateEditRequest.viewOption = EmbeddedTemplateEditRequest.ViewOptionEnum.PreparePage;

const embeddedTemplateEdited = templateApi.getEmbeddedTemplateEditUrl("YOUR_TEMPLATE_ID", embeddedTemplateEditRequest);
```

{% /codetab %}

### Query parameters

{% nestedtable %}

- {% arguments name="templateId" /%}{% batch datatype="string" /%}{% required /%}
- The ID of the template to edit.

{% /nestedtable %}

### Request body

{% nestedtable %}

- {% arguments name="RedirectURL" /%}{% batch datatype="string" /%}
- The redirect URI is to be redirected after the template edit process is completed. The string should be in URI format.

---

- {% arguments name="ShowToolbar" /%}{% batch datatype="boolean" /%}
- Controls the visibility of the toolbar at the top of the document editor.
  
  Defaults to false.

---

- {% arguments name="ViewOption" /%}{% batch datatype="string" /%}
- 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.

---

- {% 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.
  
  Defaults to true.

---

- {% arguments name="ShowCreateButton" /%}{% batch datatype="boolean" /%}
- Controls the visibility of the `Save template` button at the top right corner of the page. Set to false if you don't want your users to save the template.
  
  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 finalizing it.
  
  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="LinkValidTill" /%}{% 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="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="OnBehalfOf" /%}{% batch datatype="string" /%}
- The email address of the user that was used to create the template on their behalf.

{% /nestedtable %}

### Example response

***201 Created***

```json
{
  "editUrl": "https://app.boldsign.com/document/embed/?templateId=be5cbb00-xxxx-xxxx-xxxx-0exxxx-xxxx-f31e22cxxxxee_fZHzxxxx;41e2041f-xxxx-xxxx-xxxx-d36d4712xxxx&isEditTemplate=true"
}
```
