How can you show custom form fields to users while creating a document or template using branding?
BoldSign supports displaying custom form fields to users when creating templates or documents with a brand that has custom fields configured. This article will guide you on how to display custom form fields using branding via the API.
To display the custom form fields, set ShowSharedCustomFields
to true
when updating branding via the API.
Below are a few code examples demonstrating how to display custom form fields using branding.
Code snippet
curl -X POST 'https://api.boldsign.com/v1/brand/edit?brandId=18779cd3-xxxx-xxxx-883e-4d9ead5c699a' \ -H 'X-API-KEY: {Your API Key}' \ -F 'brandName=BoldSign' \ -F 'brandLogo={Your Brand logo}' \ -F 'backgroundColor=red' \ -F 'buttonColor=green' \ -F 'buttonTextColor=white' \ -F 'emailDisplayName={SenderName} from BoldSign' \ -F 'redirectUrl=https://www.syncfusion.com/' \ -F 'isDefault=true' \ -F 'canHideTagLine=false' \ -F 'combineAuditTrail=true' \ -F 'hideDecline=false' \ -F 'hideSave=false'\ -F 'showBuiltInFormFields=true' \ -F 'allowCustomFieldCreation=true' \ -F 'showSharedCustomFields=true' \
using BoldSign.Api; using BoldSign.Model; var apiClient = new ApiClient("https://api.boldsign.com", "{Your API Key}"); var brandingClient = new BrandingClient(apiClient); var editbrand = new BrandSettings() { BrandName = "BoldSign", BrandLogo = new ImageFileBytes() { ContentType = "image/png", FileBytes = File.ReadAllBytes("{Your file path}"), }, BackgroundColor = "red", ButtonColor = "Green", ButtonTextColor = "White", EmailDisplayName = "{SenderName} from BoldSign", RedirectUrl = " https://www.syncfusion.com/ ", IsDefault = true, CanHideTagLine = false, CombineAuditTrail = true, HideDecline = false, HideSave = false, ShowBuiltInFormFields = true, AllowCustomFieldCreation = true, ShowSharedCustomFields = true, }; BrandingData brandingData = await brandingClient.EditBrandAsync("18779cd3-xxxx-xxxx-883e-4d9ead5c699a", editbrand).ConfigureAwait(false); string brandId = brandingData.BrandId; Console.WriteLine(brandId);
import requests url = "https://api.boldsign.com/v1/brand/edit?brandId=8b115d45-0xxc-4d69-axxc-cfdbb308e095" payload={ 'brandName': '{Your Brand Name}', 'ShowBuiltInFormFields':'true', 'AllowCustomFieldCreation':'true', 'ShowSharedCustomFields':'true', 'emailDisplayName': '{Your email display name}', 'isDefault': 'true', 'canHideTagLine': 'false', 'combineAuditTrail': 'true' files=[ ('brandLogo',('file',open('filepath','rb'),'application/jpg')) ] headers = { 'X-API-KEY': '{Your API Key}' } response = requests.request("POST", url, headers=headers, data=payload, files=files) print(response.text)
const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); const form = new FormData(); form.append('brandName', '{Your brand name}'); form.append('brandLogo', fs.createReadStream('{your file path}')); form.append('emailDisplayName', '{Your email display name}'); form.append('isDefault', 'true'); form.append('canHideTagLine', 'false'); form.append('combineAuditTrail', 'false'); form.append('ShowBuiltInFormFields', 'false'); form.append('ShowSharedCustomFields', 'true'); form.append('AllowCustomFieldCreation', 'true'); async function GetData(){ try{ const response = await axios.post( 'https://api.boldsign.com/v1/brand/edit', form, { params: { 'brandId': '8b115d45-095c-4xx9-axxc-cfdbb308e095' }, headers: { ...form.getHeaders(), 'X-API-KEY': '{Your API Key}' } } ); console.log(JSON.stringify(response.data)); return response; } catch (error) { console.error('Error:', error.message); throw error; } } GetData();
Replace brandId
with the ID of the existing brand to be used for sending the document. Update brandname
,emailDisplayName
and brandlogo
according to your brand's details. After executing the code, custom form fields will be displayed when a user creates templates or documents using the updated brand.