Copy page
Copy original Markdown fileEmbedded template preview
The embedded template preview link allows users to preview an already created template on your website or mobile app using an iFrame, popup window, or a new tab.
Create embedded template preview URL
post/v1/template/createEmbeddedPreviewUrlThe create embedded template preview link includes additional properties to customize the embedded template preview process.
Code snippet
curl -X 'POST' \
'https://api.boldsign.com/v1/template/createEmbeddedPreviewUrl?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=true'
var apiClient = new ApiClient("https://api.boldsign.com", "Your_API_Key");
var templateClient = new TemplateClient(apiClient);
var embeddedTemplatePreviewRequest = new EmbeddedTemplatePreviewRequest()
{
TemplateId = "be5cbb00-xxxx-xxxx-xxxx-bafa580exxxx",
ShowToolbar = true,
};
var embeddedTemplatePreview = await this.templateApi.CreateEmbeddedPreviewUrlAsync(embeddedTemplatePreviewRequest).ConfigureAwait(false);
var templatePreviewUrl = embeddedTemplatePreview.TemplateUrl;
import boldsign
configuration = boldsign.Configuration(api_key="YOUR_API_KEY")
with boldsign.ApiClient(configuration) as api_client:
template_api = boldsign.TemplateApi(api_client)
embedded_template_preview_request = boldsign.EmbeddedTemplatePreviewJsonRequest(
show_toolbar=True
)
preview_url_response = template_api.create_embedded_preview_url(
template_id="Template_ID",
embedded_template_preview_json_request=embedded_template_preview_request
)
<?php require_once "vendor/autoload.php";
$config = new BoldSign\Configuration();
$config->setApiKey('YOUR_API_KEY');
$apiInstance = new BoldSign\Api\TemplateApi($config);
$embedded_template_preview_request = new BoldSign\Model\EmbeddedTemplatePreviewJsonRequest();
$embedded_template_preview_request->setShowToolbar(true);
$result = $apiInstance->createEmbeddedPreviewUrl("TEMPLATE_ID", $embedded_template_preview_request);
ApiClient apiClient = Configuration.getDefaultApiClient();
apiClient.setApiKey("YOUR_API_KEY");
TemplateApi templateApi = new TemplateApi(apiClient);
EmbeddedTemplatePreviewJsonRequest embeddedTemplatePreviewRequest = new EmbeddedTemplatePreviewJsonRequest();
embeddedTemplatePreviewRequest.setShowToolbar(true);
EmbeddedTemplatePreview previewUrl = templateApi.createEmbeddedPreviewUrl("TEMPLATE_ID", embeddedTemplatePreviewRequest);
import { EmbeddedTemplatePreview, EmbeddedTemplatePreviewJsonRequest, TemplateApi } from "boldsign";
const templateApi = new TemplateApi();
templateApi.setApiKey("API_KEY");
var embeddedTemplatePreview = new EmbeddedTemplatePreviewJsonRequest();
embeddedTemplatePreview.showToolbar = true;
var preview_url = templateApi.createEmbeddedPreviewUrl("TEMPLATE_ID", embeddedTemplatePreview);
Query parameters
| templateIdstringRequired | The ID of the template to preview. |
Request body
| LinkValidTillstring | Configures the expiration for the generated URL. A maximum of 30 days can be assigned. The string should be in date-time format. |
ShowToolbarboolean | Controls the visibility of the toolbar at the top of the template preview. Defaults to true. |
Example response
200 Success
{
"templateUrl": "https://app.boldsign.com/document/previewtemplate/?templateId=be5cbb00-xxxx-xxxx-xxxx-0exxxx-xxxx-f31e22cxxxxe;41e2041f-xxxx-xxxx-xxxx-xxxx-d36d4712xxxx"
}