How to add files using file URLs when sending a document for eSignature?

BoldSign allows you to add files using file URLs for e-signature using the FileUrls property. The supported file formats that can be used in FileUrls are .pdf, .png, .jpg, and .docx. The .pdf is the preferred format. You can refer to the following link for supported file formats. Make sure that the header content-type in the file URL should be in proper format like application/pdf, application/msword.

Here is an example demonstrating how to add a file using a file URL when sending a document for eSignature using the BoldSign API.

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: application/json' \
  -d '{
    "Message": "Please sign this.",
    "Signers": [
        {
            "name": "Alex",
            "emailAddress": "alexgayle@cubeflakes.com",
            "signerType": "Signer",
            "formFields": [
                {
                    "id": "sign1",
                    "name": "sign1",
                    "fieldType": "Signature",
                    "pageNumber": 1,
                    "bounds": {
                        "x": 50,
                        "y": 50,
                        "width": 125,
                        "height": 25
                    },
                    "isRequired": true
                }
              ],
            "locale": "EN"
        }
    ],

   "FileUrls": [
        "https://www.dropbox.com/scl/fi/jcya44l0ui2sq4rjl0wsg/Customer-Contract-Form-Cubeflex.pdf?rlkey=earhpfci3i2zqzugcchxkb451&st=sjbm7jcs&dl=1"
    ],
   
    "Title": "Customer-Contract-Form-Cubeflex"
  }'
  

using BoldSign.Api;
using BoldSign.Model;

var apiClient = new ApiClient("https://api.boldsign.com", "{Your API Key}");
var documentClient = new DocumentClient(apiClient);

var signatureField = new FormField(
    id: "sign",
    isRequired: true,
    type:FieldType.Signature,
    pageNumber: 1,
    bounds: new Rectangle(x: 100, y: 100, width: 100, height: 50));

var formFieldCollections = new List<FormField>()
{
    signatureField
};

var signer = new DocumentSigner(
    signerName: "Alex",
    signerType: SignerType.Signer,
    signerEmail: "alexgayle@cubeflakes.com",
    formFields: formFieldCollections,
    locale: Locales.EN);

var documentSigners = new List<DocumentSigner>()
{
    signer
};
List<Uri> uriList = new List<Uri>
{
    new Uri("https://www.dropbox.com/scl/fi/v5vj574fdb1zgkawgud8p/FL-Landlord-and-Tenant-Law-Problem.pdf?rlkey=68e21wfenuyqvolr4jl07yt8p&st=k8ryipoe&dl=1")
};
var sendForSign = new SendForSign()
{
    Message = "Please sign this",
    Title = "Agreement",
    HideDocumentId = false,
    Signers = documentSigners, 
     =  uriList
   

};
var documentCreated = documentClient.SendDocument(sendForSign);
Console.WriteLine(documentCreated);

import requests
import json

url = "https://api.boldsign.com/v1/document/send"

signer_data = {
    "name": "Alex",
    "emailAddress": "alexgayle@cubeflakes.com",
    "signerType": "Signer",
    "formFields": [
        {
            "id": "sign1",
            "name": "sign1",
            "fieldType": "Signature",
            "pageNumber": 1,
            "bounds": {
                "x": 50,
                "y": 50,
                "width": 200,
                "height": 25
            },
            "isRequired": True
        }
       
    ],
    "locale": "EN"
}

payload = {
    'Message': 'Please sign this.',
    'Signers': [signer_data],
    'Title': 'Agreement',
    'FileUrls': [
        'https://www.dropbox.com/scl/fi/jcya44l0ui2sq4rjl0wsg/Customer-Contract-Form-Cubeflex.pdf?rlkey=earhpfci3i2zqzugcchxkb451&st=sjbm7jcs&dl=1'
    ]   
}

headers = {
  'Content-Type': 'application/json',
  'accept': 'application/json',
  'X-API-KEY': '{Your API Key}'
}

response = requests.post(url, headers=headers, json=payload)
print(response.text)
const axios = require('axios');

const url = "https://api.boldsign.com/v1/document/send";

const signerData = {
  "name": "Alex",
  "emailAddress": "alexgayle@cubeflakes.com",
  "signerType": "Signer",
  "formFields": [
    {
      "id": "string",
      "name": "string",
      "fieldType": "Signature",
      "pageNumber": 1,
      "bounds": {
        "x": 50,
        "y": 50,
        "width": 200,
        "height": 25
      },
      "isRequired": true
    }
  ],
  "locale": "EN"
};

const payload = {
  'Message': 'Please sign this.',
  'Signers': [signerData],
  'Title': 'Agreement',
  'FileUrls': [
    'https://www.dropbox.com/scl/fi/jcya44l0ui2sq4rjl0wsg/Customer-Contract-Form-Cubeflex.pdf?rlkey=earhpfci3i2zqzugcchxkb451&st=sjbm7jcs&dl=1'
  ]
};

const headers = {
  'Content-Type': 'application/json',
  'accept': 'application/json',
  'X-API-KEY': '{Your API Key}'
};

axios.post(url, payload, { headers })
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error('Error:', error);
  });

In the provided code examples, make sure to replace the SignerEmail and SignerName properties with the email and name of the signer you wish to send the document. After executing the above code, document in the FileUrls will be sent to signer for signature request.