Add SMS Authentication After Sending a Document

BoldSign provides the capability to add SMS authentication for signers, even after a document has been sent for signature.

To enable SMS authentication for signers using the BoldSign API, you need to set the AuthenticationType to SMSOTP. Additionally, it is essential to include the CountryCode and Number parameters for SMS authentication. This setup ensures that the signer will receive a code via text message, which they must enter to access the document.

Below are sample code snippets that illustrate how to add SMS authentication for one of a document's recipients:

curl -X PATCH "https://api.boldsign.com/v1/document/addAuthentication?documentId={documentId}"
      -H -H 'X-API-KEY: {your API key}'
      -H "Content-Type: application/json"
      -d "{\"authenticationType\": \"SMSOTP\", \"emailId\": \"[email protected]\", \"phoneNumber\": {\"countryCode\": \"{signer country code}\", \"number\": \"{signer phone number}\"}}"
var apiClient = new ApiClient("https://api.boldsign.com", "{apikey}");
var documentclient = new DocumentClient(apiClient);
var phoneNumber = new PhoneNumber() {
  CountryCode = "{signer country code}",
Number = "{signer phone number}"
  };
await documentclient.AddAuthenticationAsync("{documentId}", "[email protected]", AuthenticationType.SMSOTP, null, phoneNumber: phoneNumber).ConfigureAwait(false);
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)

    access_code_detail = boldsign.AccessCodeDetail(
        authenticationType = "SMSOTP",
        emailId = "[email protected]",
        phone_number = boldsign.PhoneNumber(
            country_code = "{Signer country code}",
            number = "{Signer phone number}"
        )
    )

    document_api.add_authentication(document_id = "YOUR_DOCUMENT_ID", access_code_detail = access_code_detail)
<?php require_once "vendor/autoload.php";

use BoldSign\Configuration;
use BoldSign\Api\DocumentApi;
use BoldSign\Model\AccessCodeDetail;
use BoldSign\Model\PhoneNumber;

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

$document_api = new DocumentApi($config);

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

$access_code_detail = new AccessCodeDetail();
$access_code_detail->setAuthenticationType('SMSOTP');
$access_code_detail->setPhoneNumber($phone_number);
$access_code_detail->setEmailId('[email protected]');

$document_api->addAuthentication('YOUR_DOCUMENT_ID', $access_code_detail);
import com.boldsign.ApiClient;
import com.boldsign.ApiException;
import com.boldsign.Configuration;
import com.boldsign.api.DocumentApi;
import com.boldsign.model.AccessCodeDetail;
import com.boldsign.model.PhoneNumber;

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

DocumentApi documentApi = new DocumentApi(client);

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

AccessCodeDetail accessCodeDetail = new AccessCodeDetail();
accessCodeDetail.setAuthenticationType(AccessCodeDetail.AuthenticationTypeEnum.SMSOTP);
accessCodeDetail.setPhoneNumber(phoneNumber);
accessCodeDetail.setEmailId("[email protected]");

documentApi.addAuthentication("YOUR_DOCUMENT_ID", accessCodeDetail);
import { AccessCodeDetail, DocumentApi, PhoneNumber } from "boldsign";

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

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

const accessCodeDetail = new AccessCodeDetail();
accessCodeDetail.authenticationType = AccessCodeDetail.AuthenticationTypeEnum.SmsOtp;
accessCodeDetail.phoneNumber = phoneNumber;
accessCodeDetail.emailId = "[email protected]";

await documentApi.addAuthentication("YOUR_DOCUMENT_ID", accessCodeDetail);

In the provided code examples, ensure that the authenticationType is set to SMSOTP. Additionally, replace the documentId placeholder with the actual ID of the document you created. Update the SignerEmail with the signer's correct email address and provide the CountryCode and Number in the phoneNumber field.

Once the code is executed, the document will be secured with SMS OTP authentication. This means that the signer will only be able to access the document by entering the correct code that will be texted to the specified number.