Add authentication to the document

patch/v1/document/addAuthentication

The sender can enable authentication for the document, which secures the signing page. Each recipient must authenticate themselves before opening the document to sign.

There are three types of Authentication: AccessCode, EmailOTP, and SMSOTP.

  • AccessCode - A set of alphanumeric characters will be specified by the sender to the recipient for accessing the document, and the sender needs to provide the secure code directly to the recipient.
  • EmailOTP - A system generated one time password will be delivered to the recipient's mailbox that is required to access the document.
  • SMSOTP - A system generated one time password will be delivered to the recipient's phone number that is required to access the document.

Code snippet

The following sample code snippet requests the EmailOTP authentication to be added to one of the document's recipients.

curl -X PATCH "https://api.boldsign.com/v1/document/addAuthentication?documentId={documentId}" 
      -H 'X-API-KEY: {your API key}' 
      -H "Content-Type: application/json" 
      -d "{\"authenticationType\": \"EmailOTP\", \"emailId\": \"alexgayle@cubeflakes.com\"}"
var apiClient = new ApiClient("https://api.boldsign.com", "{apikey}");
var documentclient = new DocumentClient(apiClient);
await documentclient.AddAuthenticationAsync("{documentId}", " alexgayle@cubeflakes.com", AuthenticationType.EmailOTP).ConfigureAwait(false);
import requests
import json

url = "https://api.boldsign.com/v1/document/addAuthentication?documentId={documentId}"

payload = json.dumps({
  "authenticationType": "EmailOTP",
  "emailId": "alexgayle@cubeflakes.com"
})
headers = {
  'X-API-KEY': '{your API key}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios'); 
await axios.patch( 

    'https://api.boldsign.com/v1/document/addAuthentication', 
    { 
        authenticationType: 'EmailOTP', 
        emailId: 'alexgayle@cubeflakes.com' 
    }, 

    { 
        params: { documentId: '{documentId}' }, 
        headers: { 
          'X-API-KEY': '{Your API key}', 
          'Content-Type': 'application/json' 
        } 
    } 
); 

The following sample code snippet requests the AccessCode authentication to be added to one of the 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 "{\"accessCode\": \"123456\", \"authenticationType\": \"AccessCode\", \"emailId\": \"alexgayle@cubeflakes.com\"}"
var apiClient = new ApiClient("https://api.boldsign.com", "{apikey}");
var documentclient = new DocumentClient(apiClient);
await documentclient.AddAuthenticationAsync("{documentId}", "alexgayle@cubeflakes.com", AuthenticationType.AccessCode, null, "123456").ConfigureAwait(false);
import requests
import json

url = "https://api.boldsign.com/v1/document/addAuthentication?documentId={documentId}"

payload = json.dumps({
  "accessCode": "123456",
  "authenticationType": "AccessCode",
  "emailId": "alexgayle@cubeflakes.com"
})
headers = {
  'X-API-KEY': '{your API key}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios'); 
await axios.patch( 

    'https://api.boldsign.com/v1/document/addAuthentication', 

    { 
        accessCode: '123456', 
        authenticationType: 'AccessCode', 
        emailId: 'alexgayle@cubeflakes.com' 
    }, 

    { 
        params: { documentId: '{documentId}' }, 
        headers: { 
            'X-API-KEY': '{Your API key}', 
            'Content-Type': 'application/json' 
        } 
    } 
); 

The following code sample snippet requests the SMS OTP authentication to be added to one of the 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\": \"alexgayle@cubeflakes.com\", \"phoneNumber\": {\"countryCode\": \"+1\", \"number\": \"2015666802\"}}"
var apiClient = new ApiClient("https://api.boldsign.com", "{apikey}");
var documentclient = new DocumentClient(apiClient);
var phoneNumber = new PhoneNumber() { 
    CountryCode = "+1",
    Number = "2015666802"
  };
await documentclient.AddAuthenticationAsync("{documentId}", "alexgayle@cubeflakes.com", AuthenticationType.SMSOTP, null, phoneNumber: phoneNumber).ConfigureAwait(false);
import requests
import json

url = "https://api.boldsign.com/v1/document/addAuthentication?documentId={documentId}"

payload = json.dumps({
  "authenticationType": "SMSOTP",
  "emailId": "alexgayle@cubeflakes.com",
  "phoneNumber": {
    "countryCode": "+1",
    "number": "201566802"
  }
})
headers = {
  'X-API-KEY': '{your API key}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios'); 
await axios.patch( 

    'https://api.boldsign.com/v1/document/addAuthentication', 

    {
        authenticationType: 'SMSOTP', 
        emailId: 'alexgayle@cubeflakes.com',
        phoneNumber: {
            countryCode: '+1',
            number: '2015666802'
        }
    }, 

    { 
        params: { documentId: '{documentId}' }, 
        headers: { 
            'X-API-KEY': '{Your API key}', 
            'Content-Type': 'application/json' 
        } 
    } 
); 

If a document contains repeated signers with signing order, in that case the recipient's signing order can be specified along with the signer's email to add the EmailOTP authentication request, as shown in the following code snippet.

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\": \"EmailOTP\", \"emailId\": \"alexgayle@cubeflakes.com\", \"order\": 2}"
var apiClient = new ApiClient("https://api.boldsign.com", "{apikey}");
var documentclient = new DocumentClient(apiClient);
await documentclient.AddAuthenticationAsync("{documentId}", "alexgayle@cubeflakes.com", AuthenticationType.EmailOTP, 2).ConfigureAwait(false);
import requests
import json

url = "https://api.boldsign.com/v1/document/addAuthentication?documentId={documentId}"

payload = json.dumps({
  "authenticationType": "EmailOTP",
  "emailId": "alexgayle@cubeflakes.com",
  "order": 2
})
headers = {
  'X-API-KEY': '{your API key}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios'); 
await axios.patch( 

    'https://api.boldsign.com/v1/document/addAuthentication', 

    { 
        authenticationType: 'EmailOTP', 
        emailId: 'alexgayle@cubeflakes.com', 
        order: 2 

    }, 

    { 
        params: { documentId: '{documentId}' }, 
        headers: { 
          'X-API-KEY': '{Your API key}', 
          'Content-Type': 'application/json' 
        } 
    } 
); 

Query parameters

documentIdstringRequiredID of the requested document

Request body

accessCodestringAccess code is required when using AccessCode type of authentication. Otherwise, it should be empty.
authenticationTypestringRequiredIt includes AccessCode and EmailOTP authentications. If you prefer EmailOTP authentication, set the DisableEmails property in the document to false. If you prefer AccessCode authentication, you must share the access code to the recipient directly.
emailIdStringRequiredEmail address of the signer.
onBehalfOfstringIf the document is created on behalf of the sender, the sender's identity email address must be specified.
orderIntA number that denotes the signer's order, which targets the given email address present in the recipient list. The order should be in the range of 1 - 50.

phoneNumberobject

When the authentication type is specified as SMSOTP, you can provide the phone number with the country code.

countryCodestringThis property represents the country code associated with the phone number.
numberstringThis property represents the actual phone number.

Example response

200 Success