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 boldsign

configuration = boldsign.Configuration(
    api_key = "YOUR_API_KEY"
)
with boldsign.ApiClient(configuration) as api_client:

    document_api = boldsign.DocumentApi(api_client)
    
    access_code_details = boldsign.AccessCodeDetails(
        accessCode="123456"
    )
    
    change_access_code_response = document_api.change_access_code(
        document_id="YOUR_DOCUMENT_ID",
        access_code_details=access_code_details,
        email_id="alexgayle@cubeflakes.com"
    )
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 boldsign

configuration = boldsign.Configuration(
    api_key = "YOUR_API_KEY"
)
with boldsign.ApiClient(configuration) as api_client:

    document_api = boldsign.DocumentApi(api_client)
    
    access_code_details = boldsign.AccessCodeDetails(
        accessCode="123456"
    )
    
    change_access_code_response = document_api.change_access_code(
        document_id="YOUR_DOCUMENT_ID",
        access_code_details=access_code_details,
        email_id="alexgayle@cubeflakes.com",
        z_order=2
    )
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