Articles in this section
Category / Section

How to add radio buttons to the document using BoldSign API?

Published:
5 mins read

A radio button allows a signer to select only one option from a predefined list of choices. When presented as a group, selecting one radio button will automatically deselect any previously selected option within that group, ensuring that only one option can be chosen at a time.

BoldSign provides support for adding radio buttons to your document before sending it to the signer, enabling them to make a choice by clicking on the radio button.

Send a document with radio buttons

To send a document with a radio buttons, set the fieldType as RadioButton. Additionally, you need to specify a groupName to group related radio buttons together.

Here are example codes that demonstrate how to achieve this:

Code snippet

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 'Message=' \
    -F 'Signers=
    {
       "name": "Hanky",
       "emailAddress": "hankyWhites@cubeflakes.com",
       "signerType": "Signer",
       "formFields": [
          {
               "id": "string",
               "name": "string",
               "fieldType": "RadioButton",
               "groupName": "Group1",
               "pageNumber": 1,
               "bounds": {
                 "x": 50,
                 "y": 50,
                 "width": 20,
                 "height": 20
                  },
               "isRequired": true
           },
           {
               "id": "string1",
               "name": "string1",
               "fieldType": "RadioButton",
               "groupName": "Group1",
               "pageNumber": 1,
               "bounds": {
                 "x": 100,
                 "y": 100,
                 "width": 20,
                 "height": 20
                  },
               "isRequired": true
           }
       ],
       "locale": "EN"
    }' \
    -F 'Files={your file}' \
    -F 'Title={title}' \

In the above examples, make sure to replace fieldType with RadioButton and specify a groupName to group related radio buttons. Execute the provided code, making sure to provide the necessary fields such as Files, Title, and Signers. By doing so, the document will be sent to the signers with the radio buttons, allowing them to make a selection when signing.

Send a document with radio button form field using a definition tag

For the information about the definition tags, please refer to the documentation: Definition tags

Code snippet

curl -X POST 'https://api.boldsign.com/v1/document/send' \
     url -X POST 'https://api.boldsign.com/v1/document/send' \
     -H 'X-API-KEY: {your-api-key}' \
     -F 'Title=Sent from API Curl' \
     -F 'Message=This is document message sent from API Curl' \
     -F 'EnableSigningOrder=false' \
     -F 'Signers[0][Name]=Signer Name 1' \
     -F 'Signers[0][EmailAddress]=luthercooper@cubeflakes.com' \
     -F 'Signers[0][SignerOrder]=1' \
     -F 'UseTextTags=true' \
     -F 'TextTagDefinitions[0][DefinitionId]=tag1' \
     -F 'TextTagDefinitions[0][Type]=RadioButton' \
     -F 'TextTagDefinitions[0][SignerIndex]=1' \
     -F 'TextTagDefinitions[0][IsRequired]=True' \
     -F 'TextTagDefinitions[0][RadioGroupName]=string' \
     -F 'TextTagDefinitions[0][Size][Width]=20' \
     -F 'TextTagDefinitions[0][Size][Height]=20' \
     -F 'TextTagDefinitions[0][FieldId]=axq12367' \
     -F 'TextTagDefinitions[1][DefinitionId]=tag2' \
     -F 'TextTagDefinitions[1][Type]=RadioButton' \
     -F 'TextTagDefinitions[1][SignerIndex]=1' \
     -F 'TextTagDefinitions[1][IsRequired]=True' \
     -F 'TextTagDefinitions[1][RadioGroupName]=string' \
     -F 'TextTagDefinitions[1][Size][Width]=20' \
     -F 'TextTagDefinitions[1][Size][Height]=20' \
     -F 'TextTagDefinitions[1][FieldId]=eq1267' \
     -F 'Files=@{your file};type=application/pdf' \

Replace the placeholders ({your API key}, {your file}, etc.) with your actual data. Specify the Type as Radiobutton and specify a GroupName to group related radio buttons. Specify DefinitionId with the id present in the document.

After execution, a document will be created and sent to the signer’s email with radio buttons added in the tag present in the document.

For a visual reference, please take a look at the radio buttons located in the document, as shown in the following image.

Radio buttons in the document

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