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 two types of Authentication which include AccessCode and EmailOTP.

  • 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.

Code snippet

The sample code snippet below 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 sample code snippet below 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' 
        } 
    } 
); 

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 code snippet below

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

Heading1Heading2
documentIdstringRequiredID of the requested document

Request body

Heading1Heading2
accessCodestringAccess code is required when using AccessCode type of authentication. Otherwise, it should be empty.
authenticationTypestringRequiredIt includes AccessCode and EmailOTP.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.

Example response

200 Success