Articles in this section
Category / Section

How to allow signers to sign in a particular order?

Published:
5 mins read

In BoldSign, enabling the signing order option allows you to specify the sequence in which signers will receive the email and subsequently sign the document. This ensures that documents are handled in an organized and accountable manner.This guide will go through the process of how to enable signing order using BoldSign API. You can enable signers to sign in a specific order by setting EnableSigningOrder to true and configuring the SignerOrder property accordingly.

Here are example codes that can be used to achieve this:

Code snippet

cURL

curl -X 'POST' \
  'https://api.boldsign.com/v1/document/send' \
  -H 'accept: application/json' \
  -H 'X-API-KEY: {Your API Key}' \
  -H 'Content-Type: multipart/form-data' \
  -F 'Title="Sample Document"' \
  -F 'EnableSigningOrder=True' \
       -F 'Signers={
        "name": "David",
        "emailAddress": "david@cubeflakes.com",
        "signerType": "Signer",
        "signerOrder": 1,
        "formFields": [
           {
                "id": "Signature1",
                "name": "Signature2",
                "fieldType": "Signature",
                "pageNumber": 1,
                "bounds": {
                  "x": 50,
                  "y": 50,
                  "width": 125,
                  "height": 25
                   },
      "isRequired": true
    }
  ],
  "locale": "EN"
}' \
  -F 'Signers={
  "name": "hanky",
  "emailAddress": "hanky@cubeflakes.com",
  "signerType": "Signer",
  "signerOrder": 2,
  "formFields": [
           {
                "id": "Signature2",
                "name": "Signature2",
                "fieldType": "Signature",
                "pageNumber": 1,
                "bounds": {
                  "x": 100,
                  "y": 100,
                  "width": 125,
                  "height": 25
                   },
      "isRequired": true
    }

 
  ],
  "locale": "EN"
}' \
  -F 'Files=@{your file}' \

Python


import boldsign

configuration = boldsign.Configuration(api_key="Your_API_Key")

with boldsign.ApiClient(configuration) as api_client:

    document_api = boldsign.DocumentApi(api_client)

    form_fields1 = [
        boldsign.FormField(
            fieldType="Signature",
            pageNumber=1,
            bounds=boldsign.Rectangle(x=50, y=50, width=200, height=100)
        ),
    ]

    form_fields2 = [
        boldsign.FormField(
            fieldType="Signature",
            pageNumber=1,
            bounds=boldsign.Rectangle(x=100, y=100, width=200, height=100)
        ),
    ]

    document_signer1 = boldsign.DocumentSigner(
        name="David",
        emailAddress="david@cubeflakes.com",
        signerType="Signer",
        signerOrder=1,  
        formFields=form_fields1,
    )

    document_signer2 = boldsign.DocumentSigner(
        name="Hanky",
        emailAddress="hanky@cubeflakes.com",
        signerType="Signer",
        signerOrder=2, 
        formFields=form_fields2,
    )

    send_for_sign = boldsign.SendForSign(
        title="Signing order document",
        files=["Your_File_Path"], 
        signers=[document_signer1, document_signer2],
        enableSigningOrder=True,  
    )

    send_document_response = document_api.send_document(send_for_sign)

    print(send_document_response)

Node.js


const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('Message', 'Please sign this');
data.append('Signers', '{\r\n  "name": "Hanky",\r\n        "signerOrder": 1,\r\n   "emailAddress": "david@cubeflakes.com",\r\n     "signerType": "Signer",\r\n   "formFields": [\r\n   {\r\n  "id": "signature",\r\n  "name": "signature",\r\n   "fieldType": "Signature",\r\n   "pageNumber": 1,\r\n  "bounds": {\r\n "x": 50,\r\n  "y": 50,\r\n "width": 100,\r\n  "height": 25\r\n },\r\n "isRequired": true\r\n }\r\n ],\r\n  "locale": "EN"\r\n}');
data.append('Signers', '{\r\n  "name": "Cilian",\r\n   "signerOrder": 2,\r\n  "emailAddress": "hanky@cubeflakes.com",\r\n   "signerType": "Signer",\r\n  "formFields": \r\n    [\r\n  {\r\n  "id": "sign_1",\r\n  "name": "sign_1",\r\n   "fieldType": "Signature",\r\n   "pageNumber": 1,\r\n  "bounds": {\r\n  "x": 50,\r\n   "y": 50,\r\n  "width": 100,\r\n   "height": 25\r\n },\r\n  "isRequired": true\r\n }\r\n        ],\r\n  "locale": "EN"\r\n }');
data.append('Files', fs.createReadStream('{Your file path}'));
data.append('Title', 'Sample document');
data.append('EnableSigningOrder', 'true');

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.boldsign.com/v1/document/send',
  headers: { 
    'accept': 'application/json', 
    'X-API-KEY': '{Your API Key}', 
    ...data.getHeaders()
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

In conclusion, by setting EnableSigningOrder to true and configuring the SignerOrder property accordingly, you can effectively enable signers to sign documents in a predetermined sequence.
After executing the above code, the document will be created, and an email will be sent to the first signer. Once the first signer completes the signing process, an email will be sent to the next signer based on the signer order.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Access denied
Access denied