How to Request eSignature via SMS Easily

BoldSign offers options to send the documents to signers via SMS. This article guides you on how to send a document for signing via SMS using the BoldSign API.

Below are example codes for sending a document to the signer via SMS:

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 'Message=Please sign this' \
  -F 'Signers={
  "name": "David",
  "deliveryMode":"SMS",
  "phoneNumber": {
    "countryCode": "{signer country code}",
    "number": "{signer phone number}"
  },
  "signerType": "Signer",
  "signerRole": "Signer",
"formFields": [
   {
     "id": "signer",
     "fieldType": "Signature",
     "pageNumber": 1,
     "bounds": {
       "x": 50,
       "y": 100,
       "width": 100,
       "height": 60
     },
     "isRequired": true
   }
 ]
}' \
  -F 'Files=@{your file path}' \
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 BoldSign.Model.Rectangle(x: 100, y: 100, width: 125, height: 25));

var formFieldCollections = new List<FormField>()
{
    signatureField
};

        var signer = new DocumentSigner(
            signerName: "David",
            phoneNumber: new PhoneNumber(
            countryCode: "{signer country code}",
            number: "{signer phone number}"),
            formFields: formFieldCollections,
            locale: Locales.EN);

        signer.DeliveryMode = DeliveryMode.SMS;

        var documentSigners = new List<DocumentSigner>()
{
    signer
};

        var sendForSign = new SendForSign()
        {
            Signers = documentSigners,
            Title = "Sample Document",
            Message="Please sign this",
            Files = filesToUpload
        };

        var documentCreated = documentClient.SendDocument(sendForSign);
        Console.WriteLine(documentCreated.DocumentId.ToString());

import boldsign

configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key = "YOUR_API_KEY")

with boldsign.ApiClient(configuration) as api_client:
    
    document_api = boldsign.DocumentApi(api_client)
    
    send_for_sign = boldsign.SendForSign(
        title = "Document SDK API",
        document_title = "SDK Document Test case",
        description = "Testing document from SDK integration test case", 
        files = ["YOUR_FILE_PATH"],
        signers = [
            boldsign.DocumentSigner(
                name = "Hanky",
                signerOrder = 1,
                signerType = "Signer",
                deliveryMode = "SMS",
                phoneNumber = boldsign.PhoneNumber(
                    countryCode = "{Signer country code}",
                    number = "{Signer phone number}"
                ),
                formFields = [
                    boldsign.FormField(
                        name = "Sign",
                        fieldType = "Signature",
                        font = "Helvetica",
                        pageNumber = 1,
                        isRequired = True,
                        bounds = boldsign.Rectangle(x = 50, y = 50, width = 100, height = 150)
                    )
                ],
                privateMessage = "This is private message for signer"
            )
        ]
    )
    
    document_created = document_api.send_document(send_for_sign)
<?php require_once "vendor/autoload.php";

$config = new BoldSign\Configuration();
$config->setHost("https://api.boldsign.com");
$config->setApiKey('YOUR_API_KEY');

$documentApi = new BoldSign\Api\DocumentApi($config);

$phoneNumber = new BoldSign\Model\PhoneNumber();
$phoneNumber->setCountryCode('COUNTRY_CODE');
$phoneNumber->setNumber('PHONE_NNUMBER');

$bounds = new BoldSign\Model\Rectangle([
    'x' => 100,
    'y' => 100,
    'width' => 100,
    'height' => 50,
]);

$formField = new BoldSign\Model\FormField();
$formField->setFieldType('Signature');
$formField->setPageNumber(1);
$formField->setBounds($bounds);
$formField->setIsRequired(true);

$signer = new BoldSign\Model\DocumentSigner();
$signer->setName('David');
$signer->setDeliveryMode('SMS');
$signer->setPhoneNumber($phoneNumber);
$signer->setFormFields([$formField]);

$sendForSign = new BoldSign\Model\SendForSign();
$sendForSign->setTitle('Sample document');
$sendForSign->setMessage('Please sign this.');
$sendForSign->setFiles(['YOUR_FILE_PATH']);
$sendForSign->setSigners([$signer]);

$documentCreated = $documentApi->sendDocument($sendForSign);
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");

DocumentApi documentApi = new DocumentApi(client);

Rectangle bounds = new Rectangle();
bounds.setX(100f);
bounds.setY(100f);
bounds.setWidth(100f);
bounds.setHeight(50f);

FormField formField = new FormField();
formField.setFieldType(FormField.FieldTypeEnum.SIGNATURE);
formField.setPageNumber(1);
formField.setBounds(bounds);
formField.setIsRequired(true);

PhoneNumber phoneNumber = new PhoneNumber();
phoneNumber.setCountryCode("COUNTRY_CODE");
phoneNumber.setNumber("PHONE_NUMBER");

DocumentSigner signer = new DocumentSigner();
signer.setName("David");
signer.setDeliveryMode(DocumentSigner.DeliveryModeEnum.SMS);
signer.setPhoneNumber(phoneNumber);
signer.setFormFields(Arrays.asList(formField));

SendForSign sendForSign = new SendForSign();
sendForSign.setTitle("Sample document");
sendForSign.setMessage("Please sign this.");
sendForSign.setFiles(Arrays.asList(new File("YOUR_FILE_PATH")));
sendForSign.setSigners(Arrays.asList(signer));

DocumentCreated documentCreated = documentApi.sendDocument(sendForSign);
        
import { DocumentApi, FormField, Rectangle, PhoneNumber,DocumentSigner, SendForSign } from "boldsign";
import * as fs from 'fs';

const documentApi = new DocumentApi("https://api.boldsign.com");
documentApi.setApiKey("YOUR_API_KEY");

const signatureField = new FormField();
signatureField.fieldType = FormField.FieldTypeEnum.Signature;
signatureField.pageNumber = 1;
signatureField.bounds = new Rectangle();
signatureField.bounds.x = 100;
signatureField.bounds.y = 150;
signatureField.bounds.width = 30;
signatureField.bounds.height = 60;
signatureField.isRequired = true;

const phoneNumber = new PhoneNumber();
phoneNumber.countryCode = 'COUNTRY_CODE';
phoneNumber.number = 'PHONE_NUMBER';

const signer = new DocumentSigner();
signer.name = 'David';
signer.deliveryMode = DocumentSigner.DeliveryModeEnum.Sms;
signer.phoneNumber = phoneNumber;
signer.formFields = [signatureField];

const sendForSign = new SendForSign();
sendForSign.title = 'Sample document';
sendForSign.message = 'Please sign this.';
sendForSign.signers = [signer];
sendForSign.files = [fs.createReadStream('YOUR_FILE_PATH')];

const documentCreated = documentApi.sendDocument(sendForSign);

In the above examples, update the phonenumber with the phone number(along with country code) of the signer. Update the deliveryMode as SMS. Additionally, replace the Files and Title properties with the appropriate document you want to send and its title. Also, provide form fields for the document in the formFields array.

After executing the above code, the document will be created, and an SMS(Text Messages) will be sent to the signer. Now, the signer can sign the document by clicking the link in the SMS(Text Messages).