Change access code

patch/v1/document/changeAccessCode

The sender can change the access code on an already authenticated document, and you must communicate with the recipient and pass on the code.

Code snippet

Use the following sample code snippet to change the access code for the signer who has already been authenticated.

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

url = "https://api.boldsign.com/v1/document/changeAccessCode?documentId={documentId}&emailId=alexgayle@cubeflakes.com"

payload = json.dumps({
  "accessCode": "123456"
})
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/changeAccessCode?documentId={documentId}&emailId=alexgayle@cubeflakes.com', 

    { 
        accessCode: '123456' 
    }, 

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

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

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

url = "https://api.boldsign.com/v1/document/changeAccessCode?documentId={documentId}&emailId=alexgayle@cubeflakes.com&zOrder=2"

payload = json.dumps({
  "accessCode": "123456"
})
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/changeAccessCode?documentId={documentId}&emailId=alexgayle@cubeflakes.com&zOrder=2', 

    { 
        accessCode: '123456' 
    }, 

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

Query parameters

documentIdstringRequiredID of the requested document.
emailIdstringRequiredEmail address of the signer.
zOrderIntA number that denotes the signer's order, which targets the given email address present in the recipient list.

Request body

accessCodestringRequiredA set of alphanumeric characters will be specified by the sender that the recipient wants to change.
onBehalfOfstringIf the document is created on behalf of the sender, the sender's identity email address must be specified.

Example response

204 No Content