Layouts

This guide will cover how to create, retrieve, and apply layouts on documents.

Layouts allow you to create a new document package (transaction in the new UI) by using a previous document as blueprint. Once saved as a layout, you can apply it on successive documents, enabling quicker creation of packages.

Layouts in the UI

The first step is to locate your layouts in the UI. When editing documents, you will find all of your saved layouts under the toolbar as shown below. It is important to note that layouts can only be applied when document packages are in draft status.

Capture

The Code

This segment of the guide only shows snippets of code. You can download a full working code from the Developer Community Code Share, here.

In this example, document extraction is used to extract the fields and save them as a layout. If you are unsure on how to use document extraction, you can find the link to the guide, here.

After creating your package, you call on your OneSpan Sign LayoutService to create your layout from your package. You can also create a layout from an existing package. It is important to note that the layout id will required when applying layouts to documents.

String layoutId = eslClient.getLayoutService().createLayout(myPackage);
System.out.println(layoutId);

You can also retrieve all of your saved layouts. Below is a sample code on how to retrieve all your layouts:

int i = 1;
 
// The first step is to retrieve the layouts from the first page. In my example, I chose to retrieve 5 layouts at a time but you can set this to any number.
List<DocumentPackage> layouts = eslClient.getLayoutService().getLayouts(Direction.DESCENDING, new PageRequest(i, 5));
          
while (!layouts.isEmpty()) {
 
// Next, you will create your iterator object. It will enable you to iterate through your list of layouts.           
Iterator<DocumentPackage> index = layouts.iterator();
      
while (index.hasNext()) {          
   //This is where you retrieve your layout name and id.
   DocumentPackage myLayout = index.next();
   System.out.println(myLayout.getName() + " " + myLayout.getId());
   i++; 
}
       
// Finally, you will retrieve your next 5 layouts from the second page and start over up until you’ve retrieved all your layouts.    
layouts = eslClient.getLayoutService().getLayouts(Direction.DESCENDING, new PageRequest(i, 5));
}

Similarly to creating layouts, you call on your OneSpan Sign LayoutService to apply layouts.

eslClient.getLayoutService().applyLayout(packageId, "documentId", "layoutId");

Finally, to delete a layout, you call on the OneSpan Sign PackageService():

eslClient.getPackageService().deletePackage(new PackageId("layoutId"));

The Results

After running your code, you will find a list of all your layouts under the toolbar, as mentioned previously in the “Layouts in the UI” section.

Capture

Once your layout is saved, you can then apply it on subsequent documents.

Capture

Get the Code

Layouts allow you to create a new document package (transaction in the new UI) by using a previous document as blueprint. Once saved as a layout, you can apply it on successive documents, enabling quicker creation of packages.

Layouts in the UI

The first step is to locate your layouts in the UI. When editing documents, you will find all of your saved layouts under the toolbar as shown below. It is important to note that layouts can only be applied when document packages are in draft status.

Capture

The Code

This segment of the guide only shows snippets of code. You can download a full working code from the Developer Community Code Share, here.

In this example, document extraction is used to extract the fields and save them as a layout. If you are unsure on how to use document extraction, you can find the link to the guide, here.

After creating your package, you call on your OneSpan Sign LayoutService to create your layout from your package. You can also create a layout from an existing package. It is important to note that the layout id will required when applying layouts to documents.

string layoutId = eslClient.LayoutService.CreateLayout(packageFromLayout);
Debug.WriteLine(layoutId);

You can also retrieve all of your saved layouts. Below is a sample code on how to retrieve all your layouts:

int i = 1;
 
// The first step is to retrieve the layouts from the first page. In my example, I chose to retrieve 5 layouts at a time but you can set this to any number.
IList<DocumentPackage> layouts = eslClient.LayoutService.GetLayouts(Direction.DESCENDING, new PageRequest(i, 5));
 
int count = layouts.Count;
 
while (count != 0) {
 
   foreach (DocumentPackage j in layouts){
 
      //This is where you retrieve your layout name and id.
      Debug.WriteLine(j.Name + " " + j.Id);
      i++;
 
   }
    
   // Finally, you will retrieve your next 5 layouts from the second page and start over up until you’ve retrieved all your layouts.
   layouts = eslClient.LayoutService.GetLayouts(Direction.DESCENDING, new PageRequest(i, 5));
   count = layouts.Count;
 
}

Similarly to creating layouts, you call on your OneSpan Sign LayoutService to apply layouts.

eslClient.LayoutService.ApplyLayout(packageId, "documentId", "layoutId");

Finally, to delete a layout, you call on the OneSpan Sign PackageService():

eslClient.PackageService.DeletePackage(new PackageId("layoutId"));

The Results

After running your code, you will find a list of all your layouts under the toolbar, as mentioned previously in the “Layouts in the UI” section.

Capture

Once your layout is saved, you can then apply it on subsequent documents.

Capture

Get the Code

Layouts allow you to create a new document package (transaction in the new UI) by using a previous document as blueprint. Once saved as a layout, you can apply it on successive documents, enabling quicker creation of packages.

Layouts in the UI

The first step is to locate your layouts in the UI. When editing documents, you will find all of your saved layouts under the toolbar as shown below. It is important to note that layouts can only be applied when document packages are in draft status.

Capture

The Code

This segment of the guide only shows snippets of code. You can download a full working code from the Developer Community Code Share, here.

This example uses document extraction to extract the fields and saving them as a layout. If you are unsure on how to use document extraction, you can find the link to the guide, here. To save a layout from a document, you will need to make a:

HTTP Request
POST /api/layouts

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

Request Payload

{ 
   "name":"Layout 02",
   "type":"LAYOUT",
   "id":"packageId",
   "visibility":"SENDER",
   "documents":[ 
      { 
         "id":"documentId"
      }
   ]
}

For a complete description of each field, take a look at the JSON Properties section below.

Response Payload

{
  "roles": [
    {
      "id": "bjyxbrypiHw6",
      "data": null,
      "emailMessage": null,
      "attachmentRequirements": [],
      "locked": false,
      "reassign": false,
      "specialTypes": [],
      "type": "SENDER",
      "index": 0,
      "signers": [
        {
          "group": null,
          "language": "en",
          "signature": {
            "handdrawn": "AQAAADJI+a4cnf0t3Dlf0GqWJceCA+4AAwADAN8BAAADAAAAggPuAOgAAAACfyxAUkAlQCdAOUA6QDtAHEAtQBtACkAJQBVAFBIyfkA0QBVABkAYQCpAHEAtQC9ALkAtQDxAO0A6QEhAN0AlQCQyTjZAgEBwQIBAoFDSUOFQ8lDiUNJQ0lCiQHBAUCIXGVBSUCVQN1BJUDpQXVA9UE5QLlAuUDpQOVAkm1BhQLZAd0B7QFpAXUBPQTBAHkAdQAtAB2AmYBRgQmCAcJVwmHC5Mh42QFBAkECAQKBAsEDAQNBQ8VDyUPJQ81DTULRQg1ByUEGeIgQ6QDhAJ0AmQCZAFItwbHBtMhdBUCafUGJQcVCSUJFQoUDAQKBAsECBQHNAdEBEQDRABkAFYCdgR2BXYHhgd2CIYIVgdmBDYEJAUUBwQIFAkECwQLBA0EDAQLBAoEBwQGASG0xAc0BnQEhASkArQBxADEAKQAlABkAFMkVKUENQUVBBUGFQYVCRUKJQsVDCUNJQsUDQQKBAkEBwQFJAREAlIllVUHFQUVByUKFQslDSUNJQ9VDlUPZQ1lDWUKVQZVBEUCQyCxivr2BjYGRgdGB1YHZgZmBWYEdgRkAFQClAREBjQJNAk0CzQKNAs0CjQJNAQo9gRWBjYJNgs2DCYNRg1GCkYKRgY2Bkrg==",
            "textual": null
          },
          "id": "8ceWLxUo1Gg1",
          "delivery": {
            "provider": false,
            "email": true,
            "download": true
          },
          "knowledgeBasedAuthentication": null,
          "auth": {
            "scheme": "NONE",
            "challenges": []
          },
          "data": null,
          "title": "Silanis",
          "external": null,
          "updated": "2017-11-14T20:31:34Z",
          "phone": "",
          "professionalIdentityFields": [],
          "userCustomFields": [],
          "company": "Silanis",
          "email": "haris.haidary@gmail.com",
          "firstName": "Haris",
          "lastName": "Haidary",
          "name": "",
          "address": null,
          "created": "2017-11-14T20:31:34Z",
          "specialTypes": []
        }
      ],
      "name": "Owner"
    },
    {
      "id": "a3bfe56c-da0a-4ff0-bfef-efe55fd28a0c",
      "data": null,
      "emailMessage": {
        "content": ""
      },
      "attachmentRequirements": [],
      "locked": false,
      "reassign": false,
      "specialTypes": [],
      "type": "SIGNER",
      "index": 0,
      "signers": [],
      "name": "Signer1"
    },
    {
      "id": "564fd009-7673-4a5f-9314-5c5b3d5f3869",
      "data": null,
      "emailMessage": {
        "content": ""
      },
      "attachmentRequirements": [],
      "locked": false,
      "reassign": false,
      "specialTypes": [],
      "type": "SIGNER",
      "index": 0,
      "signers": [],
      "name": "Signer2"
    }
  ],
  "status": "DRAFT",
  "description": "",
  "language": "en",
  "id": "rr8lE3YwF-LaCNxSjntn2udM8hc=",
  "data": {
    "origin": "api"
  },
  "autocomplete": true,
  "documents": [
    {
      "status": "",
      "description": "",
      "id": "dfe8ac46006b31f6",
      "signedHash": null,
      "extractionTypes": [],
      "signerVerificationToken": null,
      "data": {
        "ese_document_texttag_extract_needed": "false"
      },
      "approvals": [
        {
          "id": "akmT717La0YP",
          "role": "a3bfe56c-da0a-4ff0-bfef-efe55fd28a0c",
          "data": null,
          "signed": null,
          "accepted": null,
          "fields": [
            {
              "binding": null,
              "validation": null,
              "id": "AooaSEwkp0oG",
              "page": 0,
              "data": null,
              "subtype": "FULLNAME",
              "height": 40,
              "extract": false,
              "width": 200,
              "extractAnchor": null,
              "left": 94,
              "top": 752,
              "type": "SIGNATURE",
              "value": "",
              "name": "AooaSEwkp0oG"
            }
          ],
          "name": "AooaSEwkp0oG"
        },
        {
          "id": "anR9R3fLlQYE",
          "role": "564fd009-7673-4a5f-9314-5c5b3d5f3869",
          "data": null,
          "signed": null,
          "accepted": null,
          "fields": [
            {
              "binding": null,
              "validation": null,
              "id": "AvqDbyKBeIoX",
              "page": 0,
              "data": null,
              "subtype": "FULLNAME",
              "height": 40,
              "extract": false,
              "width": 200,
              "extractAnchor": null,
              "left": 94,
              "top": 833,
              "type": "SIGNATURE",
              "value": "",
              "name": "AvqDbyKBeIoX"
            }
          ],
          "name": "AvqDbyKBeIoX"
        }
      ],
      "pages": [
        {
          "id": "",
          "height": 1030,
          "width": 796,
          "left": 0,
          "top": 0,
          "version": 0,
          "index": 0
        }
      ],
      "external": null,
      "extract": false,
      "fields": [],
      "index": 0,
      "name": "cleaning_contract",
      "size": 197171
    }
  ],
  "sender": {
    "status": "ACTIVE",
    "language": "en",
    "signature": {
      "handdrawn": "AQAAADJI+a4cnf0t3Dlf0GqWJceCA+4AAwADAN8BAAADAAAAggPuAOgAAAACfyxAUkAlQCdAOUA6QDtAHEAtQBtACkAJQBVAFBIyfkA0QBVABkAYQCpAHEAtQC9ALkAtQDxAO0A6QEhAN0AlQCQyTjZAgEBwQIBAoFDSUOFQ8lDiUNJQ0lCiQHBAUCIXGVBSUCVQN1BJUDpQXVA9UE5QLlAuUDpQOVAkm1BhQLZAd0B7QFpAXUBPQTBAHkAdQAtAB2AmYBRgQmCAcJVwmHC5Mh42QFBAkECAQKBAsEDAQNBQ8VDyUPJQ81DTULRQg1ByUEGeIgQ6QDhAJ0AmQCZAFItwbHBtMhdBUCafUGJQcVCSUJFQoUDAQKBAsECBQHNAdEBEQDRABkAFYCdgR2BXYHhgd2CIYIVgdmBDYEJAUUBwQIFAkECwQLBA0EDAQLBAoEBwQGASG0xAc0BnQEhASkArQBxADEAKQAlABkAFMkVKUENQUVBBUGFQYVCRUKJQsVDCUNJQsUDQQKBAkEBwQFJAREAlIllVUHFQUVByUKFQslDSUNJQ9VDlUPZQ1lDWUKVQZVBEUCQyCxivr2BjYGRgdGB1YHZgZmBWYEdgRkAFQClAREBjQJNAk0CzQKNAs0CjQJNAQo9gRWBjYJNgs2DCYNRg1GCkYKRgY2Bkrg==",
      "textual": null
    },
    "id": "ZQI8k6faVoM8",
    "data": {
      "serviceCredentials": "{}",
      "showIntro": false
    },
    "account": null,
    "title": null,
    "external": null,
    "updated": "2016-05-05T19:30:13Z",
    "memberships": [],
    "phone": "+1 201-555-5555",
    "professionalIdentityFields": [],
    "userCustomFields": [
      {
        "id": "policy_number_id",
        "data": null,
        "translations": [
          {
            "description": "Car Insurance Policy Number.",
            "language": "en",
            "id": "",
            "data": null,
            "name": "Policy Number"
          }
        ],
        "value": "",
        "name": ""
      }
    ],
    "locked": null,
    "activated": null,
    "company": "eSignLive",
    "email": "haris.haidary@gmail.com",
    "firstName": "Haris",
    "lastName": "Haidary",
    "type": "MANAGER",
    "name": "",
    "address": null,
    "created": "2016-05-05T19:30:13Z",
    "specialTypes": [],
    "hasDelegates": false
  },
  "emailMessage": "",
  "limits": null,
  "notarized": false,
  "notaryRoleId": null,
  "settings": {
    "ceremony": {
      "layout": {
        "header": {
          "feedback": true,
          "titleBar": null,
          "breadcrumbs": true,
          "globalActions": {
            "confirm": true,
            "download": true,
            "hideEvidenceSummary": true,
            "saveAsLayout": true
          },
          "globalNavigation": true,
          "sessionBar": true
        },
        "footer": null,
        "brandingBar": {
          "logo": {
            "link": "",
            "src": "branding"
          }
        },
        "iframe": false,
        "navigator": true
      },
      "style": null,
      "enforceCaptureSignature": false,
      "events": {
        "complete": {
          "redirect": null,
          "dialog": true
        }
      },
      "extractAcroFields": true,
      "extractTextTags": true,
      "inPerson": false,
      "declineButton": true,
      "declineReasons": [],
      "disableDeclineOther": false,
      "disableDownloadForUncompletedPackage": false,
      "disableFirstInPersonAffidavit": false,
      "disableInPersonAffidavit": false,
      "disableOptOutOther": false,
      "disableSecondInPersonAffidavit": false,
      "documentToolbarOptions": null,
      "handOver": null,
      "hideCaptureText": false,
      "hideLanguageDropdown": false,
      "hidePackageOwnerInPerson": false,
      "hideWatermark": false,
      "maxAuthFailsAllowed": 3,
      "optOutButton": true,
      "optOutReasons": []
    }
  },
  "signedDocumentDelivery": null,
  "trashed": false,
  "updated": "2017-11-14T20:31:34Z",
  "completed": null,
  "consent": null,
  "due": null,
  "visibility": "SENDER",
  "type": "LAYOUT",
  "messages": [],
  "name": "cleaning_contract",
  "created": "2017-11-14T20:31:34Z",
  "bulkSendable": true
}

It is important to note that the layout id will required when applying layouts to documents.

You can also retrieve all of your saved layouts.

HTTP Request
GET /api/layouts?from={fromPage}&to={toPage}

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

Response Payload

{
    "results": [
        {
            "roles": [
                {
                    "id": "564fd009-7673-4a5f-9314-5c5b3d5f3869",
                    "data": null,
                    "emailMessage": {
                        "content": ""
                    },
                    "attachmentRequirements": [],
                    "locked": false,
                    "reassign": false,
                    "specialTypes": [],
                    "type": "SIGNER",
                    "index": 0,
                    "signers": [],
                    "name": "Signer2"
                },
                {
                    "id": "a3bfe56c-da0a-4ff0-bfef-efe55fd28a0c",
                    "data": null,
                    "emailMessage": {
                        "content": ""
                    },
                    "attachmentRequirements": [],
                    "locked": false,
                    "reassign": false,
                    "specialTypes": [],
                    "type": "SIGNER",
                    "index": 0,
                    "signers": [],
                    "name": "Signer1"
                },
                {
                    "id": "bjyxbrypiHw6",
                    "data": null,
                    "emailMessage": null,
                    "attachmentRequirements": [],
                    "locked": false,
                    "reassign": false,
                    "specialTypes": [],
                    "type": "SENDER",
                    "index": 0,
                    "signers": [
                        {
                            "group": null,
                            "language": "en",
                            "signature": {
                                "handdrawn": "AQAAADJI+a4cnf0t3Dlf0GqWJceCA+4AAwADAN8BAAADAAAAggPuAOgAAAACfyxAUkAlQCdAOUA6QDtAHEAtQBtACkAJQBVAFBIyfkA0QBVABkAYQCpAHEAtQC9ALkAtQDxAO0A6QEhAN0AlQCQyTjZAgEBwQIBAoFDSUOFQ8lDiUNJQ0lCiQHBAUCIXGVBSUCVQN1BJUDpQXVA9UE5QLlAuUDpQOVAkm1BhQLZAd0B7QFpAXUBPQTBAHkAdQAtAB2AmYBRgQmCAcJVwmHC5Mh42QFBAkECAQKBAsEDAQNBQ8VDyUPJQ81DTULRQg1ByUEGeIgQ6QDhAJ0AmQCZAFItwbHBtMhdBUCafUGJQcVCSUJFQoUDAQKBAsECBQHNAdEBEQDRABkAFYCdgR2BXYHhgd2CIYIVgdmBDYEJAUUBwQIFAkECwQLBA0EDAQLBAoEBwQGASG0xAc0BnQEhASkArQBxADEAKQAlABkAFMkVKUENQUVBBUGFQYVCRUKJQsVDCUNJQsUDQQKBAkEBwQFJAREAlIllVUHFQUVByUKFQslDSUNJQ9VDlUPZQ1lDWUKVQZVBEUCQyCxivr2BjYGRgdGB1YHZgZmBWYEdgRkAFQClAREBjQJNAk0CzQKNAs0CjQJNAQo9gRWBjYJNgs2DCYNRg1GCkYKRgY2Bkrg==",
                                "textual": null
                            },
                            "id": "8ceWLxUo1Gg1",
                            "delivery": {
                                "provider": false,
                                "email": true,
                                "download": true
                            },
                            "knowledgeBasedAuthentication": null,
                            "auth": {
                                "scheme": "NONE",
                                "challenges": []
                            },
                            "data": null,
                            "title": "Silanis",
                            "external": null,
                            "updated": "2017-11-14T20:31:34Z",
                            "phone": "",
                            "professionalIdentityFields": [],
                            "userCustomFields": [],
                            "company": "Silanis",
                            "email": "haris.haidary@gmail.com",
                            "firstName": "Haris",
                            "lastName": "Haidary",
                            "name": "",
                            "address": null,
                            "created": "2017-11-14T20:31:34Z",
                            "specialTypes": []
                        }
                    ],
                    "name": "Owner"
                }
            ],
            "status": "DRAFT",
            "description": "",
            "language": "en",
            "id": "rr8lE3YwF-LaCNxSjntn2udM8hc=",
            "data": {
                "origin": "api"
            },
            "autocomplete": true,
            "documents": [
                {
                    "status": "",
                    "description": "",
                    "id": "dfe8ac46006b31f6",
                    "signedHash": null,
                    "extractionTypes": [],
                    "signerVerificationToken": null,
                    "data": {},
                    "approvals": [
                        {
                            "id": "akmT717La0YP",
                            "role": "a3bfe56c-da0a-4ff0-bfef-efe55fd28a0c",
                            "data": null,
                            "signed": null,
                            "accepted": null,
                            "fields": [
                                {
                                    "binding": null,
                                    "validation": null,
                                    "id": "AooaSEwkp0oG",
                                    "page": 0,
                                    "data": null,
                                    "subtype": "FULLNAME",
                                    "height": 39.99995853281021,
                                    "extract": false,
                                    "width": 199.99979266405106,
                                    "extractAnchor": null,
                                    "left": 94.00000655210017,
                                    "top": 752.0005724167823,
                                    "type": "SIGNATURE",
                                    "value": "",
                                    "name": "AooaSEwkp0oG"
                                }
                            ],
                            "name": ""
                        },
                        {
                            "id": "anR9R3fLlQYE",
                            "role": "564fd009-7673-4a5f-9314-5c5b3d5f3869",
                            "data": null,
                            "signed": null,
                            "accepted": null,
                            "fields": [
                                {
                                    "binding": null,
                                    "validation": null,
                                    "id": "AvqDbyKBeIoX",
                                    "page": 0,
                                    "data": null,
                                    "subtype": "FULLNAME",
                                    "height": 39.99995853281021,
                                    "extract": false,
                                    "width": 199.99979266405106,
                                    "extractAnchor": null,
                                    "left": 94.00000655210017,
                                    "top": 832.999669445753,
                                    "type": "SIGNATURE",
                                    "value": "",
                                    "name": "AvqDbyKBeIoX"
                                }
                            ],
                            "name": ""
                        }
                    ],
                    "pages": [
                        {
                            "id": "dfe8ac46006b31f6_0_-1_1.png",
                            "height": 1030,
                            "width": 796,
                            "left": 0,
                            "top": 0,
                            "version": 0,
                            "index": 0
                        }
                    ],
                    "external": null,
                    "extract": false,
                    "fields": [],
                    "index": 0,
                    "name": "cleaning_contract",
                    "size": 197171
                }
            ],
            "sender": {
                "status": "ACTIVE",
                "language": "en",
                "signature": {
                    "handdrawn": "AQAAADJI+a4cnf0t3Dlf0GqWJceCA+4AAwADAN8BAAADAAAAggPuAOgAAAACfyxAUkAlQCdAOUA6QDtAHEAtQBtACkAJQBVAFBIyfkA0QBVABkAYQCpAHEAtQC9ALkAtQDxAO0A6QEhAN0AlQCQyTjZAgEBwQIBAoFDSUOFQ8lDiUNJQ0lCiQHBAUCIXGVBSUCVQN1BJUDpQXVA9UE5QLlAuUDpQOVAkm1BhQLZAd0B7QFpAXUBPQTBAHkAdQAtAB2AmYBRgQmCAcJVwmHC5Mh42QFBAkECAQKBAsEDAQNBQ8VDyUPJQ81DTULRQg1ByUEGeIgQ6QDhAJ0AmQCZAFItwbHBtMhdBUCafUGJQcVCSUJFQoUDAQKBAsECBQHNAdEBEQDRABkAFYCdgR2BXYHhgd2CIYIVgdmBDYEJAUUBwQIFAkECwQLBA0EDAQLBAoEBwQGASG0xAc0BnQEhASkArQBxADEAKQAlABkAFMkVKUENQUVBBUGFQYVCRUKJQsVDCUNJQsUDQQKBAkEBwQFJAREAlIllVUHFQUVByUKFQslDSUNJQ9VDlUPZQ1lDWUKVQZVBEUCQyCxivr2BjYGRgdGB1YHZgZmBWYEdgRkAFQClAREBjQJNAk0CzQKNAs0CjQJNAQo9gRWBjYJNgs2DCYNRg1GCkYKRgY2Bkrg==",
                    "textual": null
                },
                "id": "ZQI8k6faVoM8",
                "data": {
                    "serviceCredentials": "{}",
                    "showIntro": false
                },
                "account": {
                    "id": "3vD0Dc9Fh7wQ",
                    "data": null,
                    "updated": "2016-05-05T19:30:13Z",
                    "company": {
                        "id": "jVWmyg4cyis8",
                        "data": null,
                        "address": {
                            "address1": null,
                            "address2": null,
                            "city": null,
                            "country": null,
                            "zipcode": null,
                            "state": null
                        },
                        "name": "eSignLive"
                    },
                    "licenses": [
                        {
                            "status": "ACTIVE",
                            "paidUntil": "2020-05-05T00:00:00Z",
                            "plan": {
                                "group": "",
                                "description": "E-Sign Hundreds of Documents with Unlimited Signers",
                                "id": "sandbox",
                                "features": null,
                                "price": {
                                    "amount": 0,
                                    "currency": {
                                        "id": "USD",
                                        "data": null,
                                        "name": "US Dollar"
                                    }
                                },
                                "original": null,
                                "cycle": "YEAR",
                                "contract": "YEAR",
                                "freeCycles": null,
                                "quotas": [
                                    {
                                        "cycle": null,
                                        "scope": "ACCOUNT",
                                        "limit": 100,
                                        "target": "SENDER"
                                    },
                                    {
                                        "cycle": null,
                                        "scope": "SENDER",
                                        "limit": 500,
                                        "target": "DOCUMENT"
                                    },
                                    {
                                        "cycle": null,
                                        "scope": "SENDER",
                                        "limit": 500,
                                        "target": "STORAGE"
                                    }
                                ],
                                "data": null,
                                "name": "Sandbox"
                            },
                            "transactions": [],
                            "created": "2016-05-05T19:30:13Z"
                        }
                    ],
                    "logoUrl": "",
                    "providers": null,
                    "customFields": [
                        {
                            "required": false,
                            "id": "policy_number_id",
                            "data": null,
                            "translations": [
                                {
                                    "description": "Car Insurance Policy Number.",
                                    "language": "en",
                                    "id": "",
                                    "data": null,
                                    "name": "Policy Number"
                                }
                            ],
                            "value": "123-456-789-0",
                            "name": ""
                        }
                    ],
                    "created": "2016-05-05T19:30:13Z",
                    "owner": "ZQI8k6faVoM8",
                    "name": "Haris Haidary"
                },
                "title": null,
                "external": null,
                "updated": "2016-05-05T19:30:13Z",
                "memberships": [],
                "phone": "+1 201-555-5555",
                "professionalIdentityFields": [],
                "userCustomFields": [
                    {
                        "id": "policy_number_id",
                        "data": null,
                        "translations": [
                            {
                                "description": "Car Insurance Policy Number.",
                                "language": "en",
                                "id": "",
                                "data": null,
                                "name": "Policy Number"
                            }
                        ],
                        "value": "",
                        "name": ""
                    }
                ],
                "locked": null,
                "activated": null,
                "company": "eSignLive",
                "email": "haris.haidary@gmail.com",
                "firstName": "Haris",
                "lastName": "Haidary",
                "type": "MANAGER",
                "name": "",
                "address": {
                    "address1": "",
                    "address2": "",
                    "city": "",
                    "country": "",
                    "zipcode": "",
                    "state": ""
                },
                "created": "2016-05-05T19:30:13Z",
                "specialTypes": [],
                "hasDelegates": false
            },
            "emailMessage": "",
            "limits": null,
            "notarized": false,
            "settings": {
                "ceremony": {
                    "layout": {
                        "header": {
                            "feedback": true,
                            "titleBar": null,
                            "breadcrumbs": true,
                            "globalActions": {
                                "confirm": true,
                                "download": true,
                                "hideEvidenceSummary": true,
                                "saveAsLayout": true
                            },
                            "globalNavigation": true,
                            "sessionBar": true
                        },
                        "footer": null,
                        "brandingBar": {
                            "logo": {
                                "link": "",
                                "src": "branding"
                            }
                        },
                        "iframe": false,
                        "navigator": true
                    },
                    "style": null,
                    "enforceCaptureSignature": false,
                    "events": {
                        "complete": {
                            "redirect": null,
                            "dialog": true
                        }
                    },
                    "extractAcroFields": true,
                    "extractTextTags": true,
                    "inPerson": false,
                    "declineButton": true,
                    "declineReasons": [],
                    "disableDeclineOther": false,
                    "disableDownloadForUncompletedPackage": false,
                    "disableFirstInPersonAffidavit": false,
                    "disableInPersonAffidavit": false,
                    "disableOptOutOther": false,
                    "disableSecondInPersonAffidavit": false,
                    "documentToolbarOptions": null,
                    "handOver": null,
                    "hideCaptureText": false,
                    "hideLanguageDropdown": false,
                    "hidePackageOwnerInPerson": false,
                    "hideWatermark": false,
                    "maxAuthFailsAllowed": 3,
                    "optOutButton": true,
                    "optOutReasons": []
                }
            },
            "signedDocumentDelivery": null,
            "updated": "2017-11-14T20:31:34Z",
            "consent": null,
            "due": null,
            "visibility": "SENDER",
            "type": "LAYOUT",
            "messages": [],
            "name": "cleaning_contract",
            "created": "2017-11-14T20:31:34Z",
            "notaryRoleId": null,
            "bulkSendable": false
        }
    ],
    "count": 5
}

Similarly, to apply a layout, you will need the packageId, documentId, and layoutId and use the information to make your request:

HTTP Request
POST /api/packages/{packageId}/documents/{documentId}/layout?layoutId={layoutId}

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

Request Payload

{
  "name": "Layout 02",
  "type": "LAYOUT",
  "id": "packageId",
  "visibility": "SENDER",
  "documents": [
    {
      "id": "documentId"
    }
  ]
}

Finally, to delete a layout is done with the following request:

HTTP Request
DELETE /api/packages/{layoutId}

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

The Results

After running your code, you will find a list of all your layouts under the toolbar, as mentioned previously in the “Layouts in the UI” section.

Capture

Once your layout is saved, you can then apply it on subsequent documents.

Capture

Get the Code

JSON Properties

Property Type Editable Required Default Sample Value(s)
type string Yes No PACKAGE PACKAGE / TEMPLATE / LAYOUT
name string Yes Yes n/a Layout Example
id string Yes No n/a rr8lE3YwF-LaCNxSjntn2udM8hc=
visibility string Yes No ACCOUNT ACCOUNT / SENDER
documents
id string Yes No n/a sample-contract