Edit already created template using API
If you need to modify a template that you created earlier, BoldSign provides the capability to edit templates using the API.
Create a template in your account
Before you proceed to edit a template, you must have the templates already existing within your account. If you haven't created templates yet, you can follow these steps:
To create a template in the BoldSign web application, refer to the article Create Template.
To create a template using the API, follow the steps outlined in the article Create template through API.
Edit the template using the API
Once you have templates in your account, you can proceed to edit them using the API. To edit a template within your application, you need to provide the template ID. Here's how you can achieve this:
Use the following codes to initiate the template editing process:
Code snippet
curl -X 'POST' \ 'https://api.boldsign.com/v1/template/getEmbeddedTemplateEditUrl?templateId={Your template Id}' \ -H 'accept: application/json' \ -H 'X-API-KEY: {your API key}' \ -H 'Content-Type: multipart/form-data' \ -F 'ShowTooltip=false' \ -F 'ShowCreateButton=true' \ -F 'ShowSaveButton=true' \ -F 'ShowNavigationButtons=true' \ -F 'Locale=EN' \ -F 'ViewOption=PreparePage' \ -F 'ShowPreviewButton=true' \ -F 'ShowToolbar=true' \
var apiClient = new ApiClient("https://api.boldsign.com", "Your-API-KEY"); var templateClient = new TemplateClient(apiClient); // This is an example, add your own template id. var templateId = "{Your template Id}"; var embeddedTemplateEditRequest = new EmbeddedTemplateEditRequest() { TemplateId = templateId, // customize page options ViewOption = PageViewOption.FillingPage, ShowToolbar = true, ShowNavigationButtons = false, ShowSaveButton = false, ShowPreviewButton = true, ShowCreateButton = false, ShowTooltip = false, }; var embeddedTemplateEdited = await templateClient.GetEmbeddedTemplateEditUrlAsync(embeddedTemplateEditRequest).ConfigureAwait(false); var templateEditUrl = embeddedTemplateEdited.EditUrl;
import requests url = "https://api.boldsign.com/v1/template/getEmbeddedTemplateEditUrl?templateId={Your template Id}" payload = { 'ShowToolbar': 'false', 'ViewOption': 'PreparePage', 'ShowSaveButton': 'true', 'ShowCreateButton': 'true', 'ShowPreviewButton': 'true', 'ShowNavigationButtons': 'true', 'ShowTooltip': 'false', } headers = { 'Accept': 'application/json', 'X-API-KEY': '{Your-API-KEY}' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
var axios = require('axios'); var FormData = require('form-data'); var data = new FormData(); data.append('ShowToolbar', 'false'); data.append('ViewOption', 'PreparePage'); data.append('ShowSaveButton', 'true'); data.append('ShowCreateButton', 'true'); data.append('ShowPreviewButton', 'true'); data.append('ShowNavigationButtons', 'true'); data.append('ShowTooltip', 'false'); var config = { method: 'post', url: 'https://api.boldsign.com/v1/template/getEmbeddedTemplateEditUrl?templateId={Your template Id}', headers: { 'Content-Type': 'multipart/form-data', 'Accept': 'application/json', 'X-API-KEY': 'Your-API-KEY', ...data.getHeaders() }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });
In the example above, replace
templateId
with the actual ID of the template you want to edit.Depending on your requirements, you can adjust various options such as
ShowCreateButton,
ShowSaveButton,
andShowNavigationButtons
to control the user interface elements during the editing process.The
ViewOption
field determines whether users are directed to the form field configuration pagePreparePage
or the document upload pageFillingPage.
After executing the codes, an URL will be generated in the response body.
Load the generated URL on your website. You will be redirected to the template’s filling page or prepare page based on the
ViewOption
field’s value.Once editing is completed, click
Save and proceed
to navigate to the prepare page.After making necessary modifications in the prepare page, click the
Save template
button to save the edited template.
With these steps, you can successfully edit and save an existing template using the BoldSign API.