The BoldSign mobile app is now available. Visitthis link for more details and give it a try!

The BoldSign mobile app is now available. Visitthis link for more details and give it a try!

Request Demo
BoldSign Logo Small

Features

Explore the BoldSign features that make eSigning easier.

Introducing JSON Support for BoldSign APIs

Introducing JSON Support for BoldSign APIs

We are excited to announce the addition of JSON support for BoldSign API endpoints. This new feature makes it easier for developers to integrate BoldSign’s eSignature capabilities into their applications.

Previously, BoldSign APIs for sending documents and creating templates, generating embedded request URLs, and creating embedded template URLs supported only multipart/form-data due to the inclusion of files. Now, with JSON support, the process is streamlined, making it easier for developers to manage document transactions.

Sending documents

One of BoldSign’s primary functions is sending documents for eSignatures. A document contains one or more files that need signatures. To send a document for signature using JSON, you need to construct a JSON payload with all the necessary details. Include details such as the Title, Message, Files, Signers, and FormFields. Note that the file content should be base64-encoded. The following is an example of a JSON payload:
    
curl -X 'POST' \
'https://api.boldsign.com/v1/document/send' \
-H 'accept: application/json' \
-H 'X-API-KEY: {your API key}' \
-H 'Content-Type: application/json' \
-d '{
    "Title": "Sample document",
    "Message": "Please sign this",
   "Files": [
            "data:application/pdf;base64,JVBERi0xLjcKJcfs...",
            "data:application/msword;base64,JVBERi0xLjUNCiW..."
    ],
    "Signers": [
        {
            "name": "Alex",
            "emailAddress": "alexgayle@boldsign.dev",
            "signerType": "Signer",
            "formFields": [
                {
                    "id": "string",
                    "name": "string",
                    "fieldType": "Signature",
                    "pageNumber": 1,
                    "bounds": {
                        "x": 50,
                        "y": 50,
                        "width": 200,
                        "height": 30
                    },
                    "isRequired": true
                }
            ],
            "locale": "EN"
        }
    ]    
}'
 

Creating embedded request URLs

Embedded request URLs allow you to create a unique URL that can be embedded within your application. This URL lets users send a document for others to sign.

Here’s how to create an embedded request URL with JSON using cURL:

    
curl -X POST 'https://api.boldsign.com/v1/document/createEmbeddedRequestUrl' \
-H 'X-API-KEY: {your API key}' \
-H 'Content-Type: application/json' \
-d '{
    "Title": "Sent from API Curl",
    "Locale": "EN",
    "Message": "This is document message sent from API Curl",
     "Files": [
            "data:application/pdf;base64,JVBERi0xLjcKJcfs...",
            "data:application/msword;base64,JVBERi0xLjUNCiW..."
    ],
    "Signers": [
        {
            "Name": "Alex Gayle",
            "EmailAddress": "alexgayle@boldsign.dev",
            "FormFields": [
                {
                    "FieldType": "Signature",
                    "Id": "Sign",
                    "PageNumber": 1,
                    "IsRequired": true,
                    "Bounds": {
                        "X": 50,
                        "Y": 50,
                        "Width": 200,
                        "Height": 30
                    }
                }
            ]
        }
    ],
    "ShowToolbar": true,
    "ShowNavigationButtons": true,
    "ShowPreviewButton": true,
    "ShowSendButton": true,
    "ShowSaveButton": true,
    "SendViewOption": "PreparePage",
    "ShowTooltip": false
}'
 

Creating templates

Templates in BoldSign allow you to create reusable documents with predefined fields and settings. This feature is especially useful for documents with the same structure that must be sent repeatedly.

Here’s how to create a template with JSON using cURL:

    
curl -X 'POST' \
'https://api.boldsign.com/v1/template/create' \
-H 'accept: application/json' \
-H 'X-API-KEY: {your API key}' \
-H 'Content-Type: application/json' \
-d '{
    "Title": "Sample template",
    "DocumentTitle": "Sample document",
    "DocumentMessage": "Please sign this",
    "Files": [
        "data:application/pdf;base64,JVBERi0xLjcKJcfs...",
         "data:application/msword;base64,JVBERi0xLjUNCiW..."
    ],
    "Roles": [
        {
            "name": "Hr",
            "index": 1,
            "defaultSignerName": "Alex Gayle",
            "defaultSignerEmail": "alexgayle@boldsign.dev",
            "signerType": "Signer",
            "formFields": [
                {
                    "id": "sign_id",
                    "fieldType": "Signature",
                    "pageNumber": 1,
                    "bounds": {
                        "x": 50,
                        "y": 100,
                        "width": 200,
                      "height": 30
                    },
                    "isRequired": true
                }
            ]
        }
    ]
}'
 

Creating embedded templates

Embedded templates let users design their own document templates within your application.

Here’s how to create an embedded template with JSON using cURL:

    
curl --location --request POST 'https://api.boldsign.com/v1/template/createEmbeddedTemplateUrl' \
--header 'X-API-KEY: {your API key}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Title": "Sample template",
    "DocumentTitle": "Sample document",
    "DocumentMessage": "Please sign this",
     "Files": [
        "data:application/pdf;base64,JVBERi0xLjcKJcfs...",
         "data:application/msword;base64,JVBERi0xLjUNCiW..."
    ],
    "Roles": [
        {
            "name": "Manager",
            "index": 1,
            "defaultSignerName": "Alex Gayle",
            "defaultSignerEmail": "alexgayle@boldsign.dev",
            "signerType": "Signer",
            "formFields": [
                {
                    "id": "sign_id",
                    "fieldType": "Signature",
                    "pageNumber": 1,
                    "bounds": {
                        "x": 50,
                        "y": 100,
                        "width": 200,
                        "height": 30
                    },
                    "isRequired": true
               }
            ]
        }
    ],
    "ShowToolbar": true,
    "ShowSaveButton": true,
    "ShowSendButton": true,
    "ShowPreviewButton": true,
    "ShowNavigationButtons": true,
    "ShowTooltip": false,
    "ViewOption": "PreparePage"
}'
 

Test the APIs in Postman

  1. If you do not have Postman yet, start by downloading it from getpostman.com and installing it.

  2. Once you have installed Postman, you can start adding the BoldSign API collection by clicking this Postman collection link. Refer to BoldSign API documentation for information on adding the collection.

  3. After clicking the link, a dialog will open to fork the collection into your workspace. Click the Fork Collection button.

  4. Postman Collection
    Postman Collection
  5. Enter a name for the fork in Fork label text box, select your workspace in the Workspace dropdown menu, and click Fork collection.

  6.  Fork Collection
    Fork Collection
  7. Once the collection is imported, replace {{apiBaseUrl}} with the base URL of BoldSign. If you are registered with the US region, use https://api.boldsign.com. If you are registered with the Europe region, use https://api-eu.boldsign.com. Replace {{api_key}} in the Authorization tab with your API key from BoldSign. Refer to the documentation on generating an API key.

  8. Integrate API Key
    Integrate API Key
  9. In the Body tab, add the Files property with the format data:application/{{fileType}};base64,{{base64-encoded-file-content}}.

  10. Add signers.

  11. Click Send to send the request.

  12. Embedded Request API
    Embedded Request API

Conclusion

With the introduction of JSON support for BoldSign APIs, we aim to provide a more user-friendly and versatile way for developers to integrate BoldSign into their applications. Whether you’re sending documents, creating templates, or managing embedded sending requests, the newly supported JSON format makes it easier and more efficient to work with our APIs.

Test the APIs in Postman by downloading this collection using the Postman collection link.

If you’re not a BoldSign user yet, experience the benefits of BoldSign by starting a 30-day BoldSign free trial now. Please leave a comment below—we value your feedback. If you would like more information about our services or if you need any assistance, schedule a demo or get in touch with our support team via our support portal.

Picture of Gopinath Kannusamy

Gopinath Kannusamy

Gopinath is a passionate software developer with 2 years of experience at BoldSign. He is an avid writer and enjoys sharing his insights on technology and development. In his free time, he enjoys exploring new technologies and learning new things.

Share this blog

Picture of Gopinath Kannusamy

Gopinath Kannusamy

Gopinath is a passionate software developer with 2 years of experience at BoldSign. He is an avid writer and enjoys sharing his insights on technology and development. In his free time, he enjoys exploring new technologies and learning new things.

Subscribe RSS feed

Leave a Reply

Your email address will not be published. Required fields are marked *