Combine Audit Trail and Signed Document

BoldSign provides the option to combine an audit trail with the signed document using its API.

The following are the detailed instructions on how to effectively combine signed documents with their corresponding audit trails using the API:

To initiate the process, you need to create a brand with Combine Audit Trail option enabled. This configuration will ensure that both the audit trail and the signed document are combined in the final output.

Here are example codes that can be used to do this:

curl -X 'POST' \ 'https://api.boldsign.com/v1/brand/create' \
     -H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
     -H 'X-API-KEY: {your API key}' \
     -F 'CombineAuditTrail=true' \
     -F 'BrandLogo={Your logo file}' \
     -F 'BrandName={Your brand Name}' \
var apiClient = new ApiClient("https://api.boldsign.com", " {your API key}");
var brandingClient = new BrandingClient(apiClient);
var brandSettings = new BrandSettings()
{
  BrandName = "{Your brand Name}",
  BrandLogo = new DocumentFileBytes
  {
      ContentType = "image/png",
      FileName = "{your logo file}",
  },
  CombineAuditTrail = true
};
BrandingData brandingData = await brandingClient.CreateBrandAsync(brandSettings).ConfigureAwait(false);
string brandId = brandingData.BrandId;
import boldsign

configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key = "YOUR_API_KEY")

with boldsign.ApiClient(configuration) as api_client:
    
    branding_api = boldsign.BrandingApi(api_client)

    brand_name = "TestBrandAPI"
    brand_logo = "YOUR_FILE_PATH"
    background_color = "#FFFFFF"
    button_color = "#000000"
    button_text_color = "#FFFFFF"
    
    brand_created = branding_api.create_brand(
        brand_name = brand_name,
        brand_logo = brand_logo,
        background_color = background_color,
        button_color = button_color,
        button_text_color = button_text_color,
        combine_audit_trail = True
    )
<?php require_once "vendor/autoload.php";

use BoldSign\Configuration;
use BoldSign\Api\BrandingApi;

$config = new Configuration();
$config->setHost("https://api.boldsign.com");
$config->setApiKey('YOUR_API_KEY');

$branding_api = new BrandingApi($config);

$brand_name = 'TestBrandAPI';
$brand_logo = 'YOUR_FILE_PATH';
$background_color = '#FFFFFF';
$button_color = '#000000';
$button_text_color = '#FFFFFF';
$combine_audit_trail = true;

$brand_created = $branding_api->createBrand($brand_name, $brand_logo, $background_color, $button_color, $button_text_color, $combine_audit_trail);
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");

BrandingApi brandingApi = new BrandingApi(client);

String brandName = "TestBrandAPI";
File brandLogo = new File("YOUR_FILE_PATH");
String backgroundColor = "red";
String buttonColor = "green";
String buttonTextColor = "white";
Boolean combineAuditTrail = true;

BrandCreated brandCreated = brandingApi.createBrand(brandName, brandLogo, backgroundColor, buttonColor, buttonTextColor, null, null, null, null, null, null, combineAuditTrail, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
import { BrandingApi } from "boldsign";
import * as fs from 'fs';

const createBrandApi = new BrandingApi("https://api.boldsign.com");
createBrandApi.setApiKey("YOUR_API_KEY");

const brandName = "TestBrandAPI";
const brandLogo = fs.createReadStream("YOUR_FILE_PATH");
const backgroundColor = "#FFFFFF";
const buttonColor = "#000000";
const buttonTextColor = "#FFFFFF";
const combineAuditTrail = true;

const brandCreated = createBrandApi.createBrand(brandName, brandLogo, backgroundColor, buttonColor, buttonTextColor, undefined, undefined, undefined, undefined, undefined, undefined, combineAuditTrail);

In the provided example, the crucial step is setting the CombineAuditTrail parameter to true, enabling the combination of the audit trail and the signed document. Ensure that you input the necessary details, such as BrandName and BrandLogo. The brand logo must be in formats like JPG, JPEG, or PNG. Execute the above to create a brand with the Combine Audit Trail option enabled.

Once you have a brand with the combine audit trail option enabled, proceed to create a document using the API. Associate the brand with the desired combination of the audit trail and the signed document.

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 'BrandId= {your brand ID}' \
     -F 'Message=' \
     -F 'Signers={
        "name": "Hanky",
        "emailAddress": "[email protected]",
        "signerType": "Signer",
        "formFields": [
           {
                "id": "string",
                "name": "string",
                "fieldType": "Signature",
                "pageNumber": 1,
                "bounds": {
                  "x": 50,
                  "y": 50,
                  "width": 1,
                  "height": 1
                   },
      "isRequired": true
    }
  ],
  "locale": "EN"
}' \
var apiClient = new ApiClient("https://api.boldsign.com", "{your API key}");
var documentClient = new DocumentClient(apiClient);

var documentFilePath = new DocumentFilePath
{
   ContentType = "application/pdf",
   FilePath = "agreement.pdf", 
};

var filesToUpload = new List<IDocumentFile>
{
    documentFilePath,
};

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: "David",
    signerType: SignerType.Signer,
    signerEmail: "[email protected]",
    formFields: formFieldCollections,
    locale: Locales.EN);


var documentSigners = new List<DocumentSigner>()
{
    signer
};

var sendForSign = new SendForSign()
{
   Message = "please sign this",
   Title = "Agreement",
   BrandId = "{your brand ID}",
   Signers = documentSigners,
   Files = filesToUpload
};
var documentCreated = documentClient.SendDocument(sendForSign);
import boldsign

configuration = boldsign.Configuration(host="https://api.boldsign.com", api_key="YOUR_API_KEY")

with boldsign.ApiClient(configuration) as api_client:
    
    document_api = boldsign.DocumentApi(api_client)
    
    send_for_sign = boldsign.SendForSign(
        title = "Document SDK API",
        document_title = "SDK Document Test case",
        description = "Testing document from SDK integration test case", 
        files = ["YOUR_FILE_PATH"],
        brandId = "YOUR_BRAND_ID",
        signers = [
            boldsign.DocumentSigner(
                name = "Hanky",
                emailAddress = "[email protected]",
                signerOrder = 1,
                signerType = "Signer",
                formFields = [
                    boldsign.FormField(
                        name = "Sign",
                        fieldType = "Signature",
                        font = "Helvetica",
                        pageNumber = 1,
                        isRequired = True,
                        bounds = boldsign.Rectangle(x = 50, y = 50, width = 100, height = 150)
                    )
                ]
            )
        ]
    )
    
    document_created = document_api.send_document(send_for_sign)
<?php require_once "vendor/autoload.php";

use BoldSign\Configuration;
use BoldSign\Api\DocumentApi;
use BoldSign\Model\{FormField, Rectangle, DocumentSigner, SendForSign};

$config = new Configuration();
$config->setHost("https://api.boldsign.com");
$config->setApiKey('YOUR_API_KEY');

$document_api = new DocumentApi($config);

$form_field = new FormField();
$form_field->setName('Sign');
$form_field->setFieldType('Signature');
$form_field->setPageNumber(1);
$form_field->setIsRequired(true);
$bounds = new Rectangle(['x' => 50, 'y' => 50, 'width' => 100, 'height' => 150]);
$form_field->setBounds($bounds);

$document_signer = new DocumentSigner();
$document_signer->setName('Hanky');
$document_signer->setEmailAddress('[email protected]');
$document_signer->setSignerType('Signer');
$document_signer->setFormFields([$form_field]);

$send_for_sign = new SendForSign();
$send_for_sign->setTitle('Document SDK API');
$send_for_sign->setFiles(['YOUR_FILE_PATH']);
$send_for_sign->setBrandId('YOUR_BRAND_ID');
$send_for_sign->setSigners([$document_signer]);

$document_created = $document_api->sendDocument($send_for_sign);
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");
DocumentApi documentApi = new DocumentApi(client);

FormField formField = new FormField();
formField.setName("Sign");
formField.setFieldType(FormField.FieldTypeEnum.SIGNATURE);
formField.setPageNumber(1);
formField.setIsRequired(true);
Rectangle bounds = new Rectangle().x(50f).y(50f).width(100f).height(150f);
formField.setBounds(bounds);

DocumentSigner signer = new DocumentSigner();
signer.setName("Hanky");
signer.setEmailAddress("[email protected]");
signer.setSignerType(DocumentSigner.SignerTypeEnum.SIGNER);
signer.setFormFields(Arrays.asList(formField));

SendForSign sendForSign = new SendForSign();
sendForSign.setTitle("Document SDK API");
sendForSign.setFiles(Arrays.asList(new File("YOUR_FILE_PATH")));
sendForSign.setBrandId("YOUR_BRAND_ID");
sendForSign.setSigners(Arrays.asList(signer));

DocumentCreated documentCreated = documentApi.sendDocument(sendForSign);
import { DocumentApi, SendForSign, DocumentSigner, FormField, Rectangle } from "boldsign";
import * as fs from 'fs';

const documentApi = new DocumentApi("https://api.boldsign.com");
documentApi.setApiKey("YOUR_API_KEY");

const formField = new FormField();
formField.name = "Sign";
formField.fieldType = FormField.FieldTypeEnum.Signature;
formField.pageNumber = 1;
formField.isRequired = true;
const bounds = new Rectangle();
bounds.x = 50;
bounds.y = 50;
bounds.width = 100;
bounds.height = 150;
formField.bounds = bounds;

const signer = new DocumentSigner();
signer.name = "Hanky";
signer.emailAddress = "[email protected]";
signer.signerType = DocumentSigner.SignerTypeEnum.Signer;
signer.formFields = [formField];

const sendForSign = new SendForSign();
sendForSign.title = "Document SDK API";
sendForSign.files = [fs.createReadStream("YOUR_FILE_PATH")];
sendForSign.brandId = "YOUR_BRAND_ID";
sendForSign.signers = [signer];

const documentCreated = await documentApi.sendDocument(sendForSign);

In the provided example, replace BrandId with the actual brand id in which the combine audit trail option is enabled. Once the signer completes the signing process, you can download the document containing both the signed document and the accompanying audit trail.