How to Request Signature by Email and SMS

BoldSign allows you to send a document from template and notify signer via Email and SMS using the API. If you want to send the same set of documents repeatedly, you can create a template with the document and use the template to send out for signature.

  1. Create a template in BoldSign's web app. See How to Create a Template in the BoldSign Web App for instructions.
  2. The default delivery option will be Email. You can set the delivery option to Email & SMS while creating the template.

Alternatively, if you do not set Email & SMS as the delivery option while creating the template, you can configure this using the API when sending the document using the template.

Below are example codes for sending a document using a template to the signer via Email and SMS:

curl -X 'POST' \
  'https://api.boldsign.com/v1/template/send?templateId=8fbed3d0-yyyy-xxxx -21f041809b72' \
  -H 'accept: application/json' \
  -H 'X-API-KEY: {Your API Key}' \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "Testing",
  "message": "msg",
  "roles": [
    {
      "roleIndex": 1,
      "signerName": "Alex",
      "signerEmail": "[email protected]",      
      "phoneNumber": {
        "countryCode": "{Signer's Country Code}",
        "number": "{Signer's Phone Number}"
      },
      "deliveryMode": "EmailAndSMS",
      "signerType": "Signer",
      "signerRole": "HR"
    }
  ],
  "sendViaSMS": true
 }'

var apiClient = new ApiClient("https://api.boldsign.com", "{Your API Key}");
var templateClient = new TemplateClient(apiClient);

var templateRole = new Roles()
{
    SignerName = "Alex",
    SignerEmail = "[email protected]",
    SignerRole = "HR",
    SignerType = SignerType.Signer,
    RoleIndex = 1,
    DeliveryMode = DeliveryMode.EmailAndSMS,
    PhoneNumber = new PhoneNumber() { CountryCode="{Signer's Country Code}",Number = "{Signer's Phone Number}"},
};

var roles = new List<Roles>
  {
    templateRole,
  };

var sendForSignFromTemplate = new SendForSignFromTemplate()
{
    TemplateId = "8fbed3d0-yyyy-xxxx-21f041809b72",
    Roles = roles
};

var documentCreated = templateClient.SendUsingTemplate(sendForSignFromTemplate);

import boldsign

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

with boldsign.ApiClient(configuration) as api_client:

    template_api = boldsign.TemplateApi(api_client)
    
    send_for_sign_from_template_form = boldsign.SendForSignFromTemplateForm(
        title = "Sample Template",
        message = "Please sign this document.",
        roles = [
            boldsign.Role(
                roleIndex = 1,
                signerName = "Alex",
                signerEmail = "[email protected]",
                deliveryMode = "EmailAndSMS",
                phoneNumber = boldsign.PhoneNumber(
                    countryCode = "{Signer country code}",
                    number = "{Signer phone number}"
                )
            )
        ]
    )

    document_created = template_api.send_using_template(
        template_id = "YOUR_TEMPLATE_ID",
        send_for_sign_from_template_form = send_for_sign_from_template_form
    )
<?php require_once('vendor/autoload.php');

use BoldSign\Configuration;
use BoldSign\Api\TemplateApi;
use BoldSign\Model\PhoneNumber;
use BoldSign\Model\Role;
use BoldSign\Model\SendForSignFromTemplateForm;

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

$template_api = new TemplateApi($config);

$phone_number = new PhoneNumber();
$phone_number->setCountryCode("COUNTRY_CODE");
$phone_number->setNumber("PHONE_NUMBER");

$role = new Role();
$role->setRoleIndex(1);
$role->setSignerName("Alex");
$role->setSignerEmail("[email protected]");
$role->setDeliveryMode("EmailAndSMS");
$role->setPhoneNumber($phone_number);

$send_for_sign_from_template_form = new SendForSignFromTemplateForm();
$send_for_sign_from_template_form->setTitle("Testing");
$send_for_sign_from_template_form->setMessage("msg");
$send_for_sign_from_template_form->setRoles([$role]);

$document_created = $template_api->sendUsingTemplate("YOUR_TEMPLATE_ID", $send_for_sign_from_template_form);
import * as boldsign from "boldsign";

const templateApi = new boldsign.TemplateApi("https://api.boldsign.com");
templateApi.setApiKey('YOUR_API_KEY');

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

const role = new boldsign.Role();
role.roleIndex = 1;
role.signerName = "Alex";
role.signerEmail = "[email protected]";
role.deliveryMode = boldsign.Role.DeliveryModeEnum.EmailAndSms;
role.phoneNumber = phoneNumber;

const sendForSignFromTemplateForm = new boldsign.SendForSignFromTemplateForm();
sendForSignFromTemplateForm.title = "Testing";
sendForSignFromTemplateForm.message = "msg";
sendForSignFromTemplateForm.roles = [role];

templateApi.sendUsingTemplate("YOUR_TEMPLATE_ID", sendForSignFromTemplateForm);
import java.util.Arrays;
import com.boldsign.ApiClient;
import com.boldsign.ApiException;
import com.boldsign.Configuration;
import com.boldsign.api.TemplateApi;
import com.boldsign.model.DocumentCreated;
import com.boldsign.model.PhoneNumber;
import com.boldsign.model.Role;
import com.boldsign.model.SendForSignFromTemplateForm;

ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");

TemplateApi templateApi = new TemplateApi(client);

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

Role role = new Role();
role.setRoleIndex(1);
role.setSignerName("Alex");
role.setSignerEmail("[email protected]");
role.setDeliveryMode(Role.DeliveryModeEnum.EMAIL_AND_SMS);
role.setPhoneNumber(phoneNumber);

SendForSignFromTemplateForm sendForSignFromTemplateForm = new SendForSignFromTemplateForm();
sendForSignFromTemplateForm.setTitle("Testing");
sendForSignFromTemplateForm.setMessage("msg");
sendForSignFromTemplateForm.setRoles(Arrays.asList(role));
DocumentCreated documentCreated = templateApi.sendUsingTemplate("YOUR_DOCUMENT_ID", sendForSignFromTemplateForm);

In the above example, update the templateId with the ID of the template you created earlier. Update the deliveryMode as EmailAndSMS. Then, update the SignerEmail and SignerName properties with the email and name of the signer you want to send the document to.

After executing the above code, the document will be created, and an email and sms will be sent to the signer. Now, the signer can sign the document by clicking the link in the email or in the text message.