1
votes

I'm trying to create an envelope in docusign with the checkbox will be mandatory. I tried to apply it by using a Tab Groups tab. Below is my request. I'm able to create a document but the checkboxes are still optional. I'm not sure what's wrong in may request: Please check. Thank you.

{
    "documents":[
            {
                "documentBase64":"<pdffile>",
                "documentId":"1",
                "fileExtension":"pdf",
                "name":"Document_Name"
            }
        ],
    "emailSubject":"Some Email Subject",
    "recipients":{
        "signers":[
            {
                "email":"some.user@gmail.com",
                "name":"Some People",
                "recipientId":"4250",
                "routingOrder":"1",
                "tabs":{
                    "signHereTabs":[
                        {
                            "anchorString":"PLEASE SIGN HERE",
                            "anchorXOffset":"0",
                            "anchorYOffset":"1.5",
                            "anchorUnits":"cms"
                        }
                    ],
                    "checkboxTabs":[
                        {
                            "tabLabel":"checkbox1",
                            "selected":"false",
                            "required":"false",
                            "documentId":"1",
                            "recipientId":"1",
                            "anchorString":"[x]",
                            "anchorXOffset":"0",
                            "anchorYOffset":"0",
                            "anchorUnits":"cms",
                            "tabGroupLabels":["Checkbox Group"]
                        },
                        {
                            "tabLabel":"checkbox2",
                            "selected":"false",
                            "required":"false",
                            "documentId":"1",
                            "recipientId":"1",
                            "anchorString":"[x]",
                            "anchorXOffset":"0",
                            "anchorYOffset":"1",
                            "anchorUnits":"cms",
                            "tabGroupLabels":["Checkbox Group"]
                        }
                    ],
                    "tabGroups":[
                        {
                            "recipientId":"1",
                            "tabLabel":"Check Boxes",
                            "groupLabel":"Checkbox Group",
                            "groupRule":"SelectAtMost",
                            "maximumAllowed" :"1",
                            "minimumRequired":"0",
                            "validationMessage":"Please check a box",
                            "tabScope":"Document",
                            "locked":"false"
                        }
                    ]
                }
            }
        ]
    },
    "status":"sent"
}

UPDATE:

I tried this in my request and still, the checkbox remained optional.

"tabs":{
    "signHereTabs":[
        {
            "anchorString":"PLEASE SIGN HERE",
            "anchorXOffset":"0",
            "anchorYOffset":"1.5",
            "anchorUnits":"cms"
        }
    ],
    "checkboxTabs":[
        {
            "anchorString":"[x]",
            "anchorXOffset":"0",
            "anchorYOffset":"0",
            "anchorUnits":"cms",
            "tabGroupLabels":[
                "Checkbox Group"
            ]
        }
    ],
    "tabGroups":[
        {
            "groupLabel":"Checkbox Group",
            "groupRule":"SelectAtLeast",
            "maximumAllowed":"1",
            "minimumRequired":"1",
            "validationMessage":"Please check a box",
            "tabScope":"document"
        }
    ]
}

I'm using version 2.1, /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}

Thank you in advance.

1
WELCOME to StackOverflow! Please check (accept) the best answer to each of your questions! THANK YOU!Larry K
Please first try using the exact same request that I suggest. You left out the pageNumber and documentId attributes from the tabGroups array....Larry K

1 Answers

1
votes

The required attribute for a checkbox does not apply. Instead create a tabGroup for the checkbox or checkboxes. That way you can require that the checkbox be checked, or require that one of the multiple checkboxes be checked, etc.

Example: one required checkbox

{
    "emailSubject": "Please sign the attached document",
    "status": "sent",
    "documents": [
      {
        "documentBase64":"<pdffile>",
        "name": "Example document",
        "fileExtension": "pdf",
        "documentId": "1"
      }
    ],
    "recipients": {
      "signers": [
        {
          "email": "signer_email@example.com",
          "name": "Signer's name",
          "recipientId": "1",
          "clientUserId": "1000",
          "tabs": {
            "signHereTabs": [
              {
                "anchorString": "/sig1/",
                "anchorXOffset": "20",
                "anchorUnits": "pixels"
              }
            ],
            "checkboxTabs": [
              {
                "anchorString": "/sig1/",
                "anchorXOffset": "180",
                "anchorUnits": "pixels",
                "tabGroupLabels": [
                  "checkbox group"
                ]
              }
            ],
            "tabGroups": [
              {
                "groupLabel": "checkbox group",
                "groupRule": "SelectAtLeast",
                "minimumRequired": "1",
                "maximumAllowed": "1",
                "validationMessage": "Please check to indicate your agreement",
                "tabScope": "document",
                "pageNumber": "1",
                "documentId": "1"
              }
            ]
          }
        }
      ]
    }
}