How to send a private message to the signer when sending a document via API?
BoldSign supports sending private messages to signers when sending a document via API. This feature is particularly useful when you need to provide specific instructions or information to individual signers. The sender can send a private message to each recipient when sending a document.
Below are example codes for sending a private message to a signer:
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 'Title="Invitation form"' \ -F 'Signers={ "name": "hanky", "emailAddress": "hankyWhites@gmail.com", "privateMessage": "This is private message for signer", "signerType": "Signer", "signerRole": "Signer", "formFields": [ { "id": "Signature", "name": "Signature", "fieldType": "Signature", "pageNumber": 1, "bounds": { "x": 100, "y": 100, "width": 125, "height": 25 }, "isRequired": true } ], "locale": "EN" }' \ -F 'Signers={ "name": "Cilian", "emailAddress": "cilianmurphy@cubeflakes.com", "signerType": "Signer", "signerRole": "Signer", "formFields": [ { "id": "Signature1", "name": "Signature", "fieldType": "Signature", "pageNumber": 1, "bounds": { "x": 100, "y": 150, "width": 125, "height": 25 }, "isRequired": true } ], "locale": "EN" }' \ -F 'Files=@{your file}' \
var apiClient = new ApiClient("https://api.boldsign.com", "{Your API key}"); var documentClient = new DocumentClient(apiClient); var documentFilePath = new DocumentFilePath { ContentType = "application/pdf", FilePath = "{Your File path}" }; var filesToUpload = new List<IDocumentFile> { documentFilePath, }; var signatureField = new FormField( id: "Signature", isRequired: true, type: FieldType.Signature, pageNumber: 1, bounds: new Rectangle(x: 100, y: 100, width: 125, height: 25)); var signatureField1 = new FormField( id: "Signature1", isRequired: true, type: FieldType.Signature, pageNumber: 1, bounds: new Rectangle(x: 100, y: 150, width: 125, height: 25)); var formFieldCollections = new List<FormField>() { signatureField }; var formFieldCollections1 = new List<FormField>() { signatureField1 }; var signer = new DocumentSigner( signerName: "Hanky", signerType: SignerType.Signer, signerEmail: "hankyWhites@gmail.com", privateMessage: "This is private message for signer", formFields: formFieldCollections, locale: Locales.EN); var signer1 = new DocumentSigner( signerName: "Cilian", signerType: SignerType.Signer, signerEmail: "cilianmurphy@cubeflakes.com", formFields: formFieldCollections1, locale: Locales.EN); var documentSigners = new List<DocumentSigner>() { signer, signer1 }; var sendForSign = new SendForSign() { Title = "Sample Document", HideDocumentId = false, Signers = documentSigners, Files = filesToUpload, }; var documentCreated = documentClient.SendDocument(sendForSign);
import requests import json url = "https://api.boldsign.com/v1/document/send" signer_data = { "name": "Hanky", "emailAddress": "hankyWhites@gmail.com", "privateMessage": "This is private message for signer", "signerType": "Signer", "signerRole": "Signer", "formFields": [ { "id": "Signature", "name": "Signature", "fieldType": "Signature", "pageNumber": 1, "bounds": { "x": 100, "y": 100, "width": 125, "height": 25 }, "isRequired": True } ], "locale": "EN" } signer_data1 = { "name": "Cilian", "emailAddress": "cilianmurphy@cubeflakes.com", "signerType": "Signer", "signerRole": "Signer", "formFields": [ { "id": "Signature1", "name": "Signature", "fieldType": "Signature", "pageNumber": 1, "bounds": { "x": 100, "y": 150, "width": 125, "height": 25 }, "isRequired": True } ], "locale": "EN" } payload = { 'Signers': [json.dumps(signer_data), json.dumps(signer_data1)], 'Title': "Sample Document" } files = [ ('Files', ('{Your file name}', open('{Your file path}', 'rb'), 'application/pdf')) ] headers = { 'accept': 'application/json', 'X-API-KEY': '{Your API key}' } response = requests.post(url, headers=headers, data=payload, files=files) print(response.text)
const axios = require('axios'); const FormData = require('form-data'); const fs = require('fs'); let data = new FormData(); data.append('Signers', '{\r\n "name": "hanky",\r\n "emailAddress": "hankyWhites@gmail.com",\r\n "signerType": "Signer",\r\n "signerRole": "Signer",\r\n,\r\n "privateMessage": "This is private message for signer",\r\n "formFields": [\r\n {\r\n "id": "Signature",\r\n "name": "Signature",\r\n "fieldType": "Signature",\r\n "pageNumber": 1,\r\n "bounds": {\r\n "x": 100,\r\n "y": 100,\r\n "width": 125,\r\n "height": 25\r\n },\r\n "isRequired": true\r\n}\r\n ],\r\n "locale": "EN"\r\n}'); data.append('Title', "Sample Document"); data.append('Signers', '{\r\n "name": "cilian",\r\n "emailAddress": "cilianmurphy@cubeflakes.com",\r\n "signerType": "Signer",\r\n "signerRole": "Signer",\r\n "formFields": [\r\n {\r\n "id": "Signature1",\r\n "name": "Signature",\r\n "fieldType": "Signature",\r\n "pageNumber": 1,\r\n "bounds": {\r\n "x": 100,\r\n "y": 150,\r\n "width": 125,\r\n "height": 25\r\n },\r\n "isRequired": true\r\n}\r\n ],\r\n "locale": "EN"\r\n}'); data.append('Title', "Sample Document"); data.append('Files', fs.createReadStream('{Your file path}')); 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 }; axios.request(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); });
<?php require_once "vendor/autoload.php"; use GuzzleHttp\Client; use GuzzleHttp\Psr7\Request; use \GuzzleHttp\Psr7\Utils; $client = new Client([ 'verify' => false, // Disable SSL verification ]); $headers = [ 'accept' => 'application/json', 'X-API-KEY' => '{Your API Key}' ]; $options = [ 'multipart' => [ [ 'name' => 'Signers', 'contents' => '{ "name": "David", "emailAddress": "david@boldsign.dev", "signerType": "Signer", "privateMessage" : "This is private message for signer", "formFields": [ { "id": "Signature", "fieldType": "Signature", "pageNumber": 1, "bounds": { "x": 100, "y": 100, "width": 125, "height": 25 }, "isRequired": true } ], "locale": "EN" }' ], [ 'name' => 'Signers', 'contents' => '{ "name": "Henry", "emailAddress": "henry@boldsign.dev", "signerType": "Signer", "formFields": [ { "id": "Signature1", "fieldType": "Signature", "pageNumber": 1, "bounds": { "x": 100, "y": 150, "width": 125, "height": 25 }, "isRequired": true } ], "locale": "EN" }' ], [ 'name' => 'Title', 'contents' => 'Sample' ], [ 'name' => 'Files', 'contents' => Utils::tryFopen('{Your File Path}', 'r'), 'filename' => '{Your File name}', 'headers' => [ 'Content-Type' => 'application/pdf' ] ] ]]; $request = new Request('POST', 'https://api.boldsign.com/v1/document/send', $headers); $res = $client->sendAsync($request, $options)->wait(); echo $res->getBody(); ?>
In the example above, set the privateMessage
property with the desired message you want to send to each signer. By executing any of the provided code examples, the document will be sent for signature, and each signer will receive the specified private message intended for them.