To create the checkbox with the rule, first, create the checkbox tabs and associate them with the TabGroup through the TabGroupLabels. In the TabGroup object, you can specify the checkbox rule through the GroupRule, MinimumRequired, and MaximumReqiured properties. More information about the available value for the above properties is here: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/#schema__envelopedefinition_recipients_signers_tabs_checkboxtabs_required
C# code example below allows the recipient to select only one checkbox between 3 of them.
Checkbox checkbox1 = new Checkbox
{
TabLabel = "LionTab",
DocumentId = "1",
PageNumber = "1",
RecipientId = "1",
XPosition = "200",
YPosition = "300",
TabGroupLabels = new List<string>
{
"checkboxgroup1"
}
};
Checkbox checkbox2 = new Checkbox
{
TabLabel = "TigerTab",
DocumentId = "1",
PageNumber = "1",
RecipientId = "1",
XPosition = "220",
YPosition = "300",
TabGroupLabels = new List<string>
{
"checkboxgroup1"
}
};
Checkbox checkbox3 = new Checkbox
{
TabLabel = "BearTab",
DocumentId = "1",
PageNumber = "1",
RecipientId = "1",
XPosition = "240",
YPosition = "300",
TabGroupLabels = new List<string>
{
"checkboxgroup1"
}
};
TabGroup checkboxTabGroup = new TabGroup
{
GroupLabel = "checkboxgroup1",
ValidationMessage = "Please check a box",
GroupRule = "SelectExactly",
MinimumRequired = "1",
MaximumAllowed = "1",
RecipientId = "1",
DocumentId = "1",
PageNumber = "1",
XPosition = "0",
YPosition = "0",
TabScope = "Document", // or "envelope"
TabType = "tabgroup"
};
Tabs signer1Tabs = new Tabs
{
SignHereTabs = new List<SignHere> { signHere1 },
CheckboxTabs = new List<Checkbox> { checkbox1, checkbox2, checkbox3 },
TabGroups = new List<TabGroup> { checkboxTabGroup }
};
signer1.Tabs = signer1Tabs;