How to set signer language for an eSignature document using BoldSign API?
BoldSign supports setting the language for signers to enhance understanding and convenience. This article will guide you on how to set the language for signers using the API.
You can allow your signers to receive emails in their preferred language. The currently supported languages include English, German, Spanish, French, Romanian, Norwegian, Bulgarian, Italian, Danish, Polish, Portuguese, Czech, Dutch, Russian, and Swedish. When sending the signature request, all the signer-related transaction emails and signing page static contents will be translated into the signer’s specified language.
You can set the signer’s language by configuring the signer’s locale
property and the DocumentInfo
locale
property.
Below are a few code examples demonstrating how to set the language for signers:
Code snippet
curl -X 'POST' \
'https://api.boldsign.com/v1/document/send' \
-H 'accept: application/json' \
-H 'X-API-KEY: {Your API Key}' \
-H 'Content-Type: multipart/form-data' \
-F 'Signers={
"name": "David",
"emailAddress": "david@cubeflakes.com",
"formFields": [
{
"id": "string",
"fieldType": "Signature",
"pageNumber": 1,
"bounds": {
"x": 100,
"y": 100,
"width": 100,
"height": 20
},
"isRequired": true
}
],
"locale": "PT"
}' \
-F 'Files={Your file path}' \
-F 'DocumentInfo[locale]="PT"' \
-F 'Title=Signer language' \
Python
import requests
import json
url = "https://api.boldsign.com/v1/document/send"
signer_data = {
"name": "David",
"emailAddress": "david@cubeflakes.com",
"signerType": "Signer",
"signerRole": "Signer",
"formFields": [
{
"id": "Signature",
"type": "FieldType.Signature",
"pageNumber": 1,
"bounds": {
"x": 100,
"y": 100,
"width": 200,
"height": 100
},
"isRequired": True,
}
],
"locale": "PT"
}
headers = {
'accept': 'application/json',
'X-API-KEY': '{your API key}'
}
payload = {
'Signers': json.dumps(signer_data),
'DocumentInfo': json.dumps({
"locale": "PT",
"title": "Sample document",
"description": "Please sign the document"
}),
}
files = [
('Files', ('{Your file name}', open('{Your file path}', 'rb'), 'application/pdf'))
]
response = requests.post(url, headers=headers, data=payload, files=files)
print(response.text)
NodeJS
const axios = require('axios');
async function GetData(){
try{
const FormData = require('form-data');
const fs = require('fs');
data.append('Files', fs.createReadStream('{Your file path}'));
data.append('Signers', '{\r\n "name": "David", \r\n "emailAddress": "david@cubeflakes.com",\r\n "signerType": "Signer",\r\n "formFields": [\r\n {\r\n "id": "Signature",\r\n "Type": "FieldType.Signature", \r\n "pageNumber": 1,\r\n "bounds": {\r\n "x": 100,\r\n "y": 100,\r\n "width": 200,\r\n "height": 200\r\n }, \r\n "isRequired": true\r\n}\r\n ],\r\n "locale": "PT"\r\n}');
data.append('Title', "Sample Document node js");
data.append('DocumentInfo', '{\r\n "locale": "PT",\r\n "title": "Sample Document",\r\n "description": "Please sign this"\r\n }');
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.boldsign.com/v1/document/send',
headers: {
'accept': 'application/json',
'X-API-KEY': '{Your API Key}',
...data.getHeaders()
},
data : data
};
const response = await axios.request(config);
console.log(JSON.stringify(response.data));
return response.data.documentId;
}
catch (error) {
console.error('Error:', error.message);
throw error; // Propagate the error
}
GetData();
Replace the values (Files, Signers, etc.) with the appropriate values. Set the Locale
field to your desired language code. Additionally, provide DocumentInfo
with the required details if you intend to send the document in languages other than English (EN). Upon execution, the document will be created, and a document ID will be generated.