hsamson

Forcing a defined order for documents

0 votes
I want to ensure documents are signed in a particular order. Does eSignLive have the ability to do this? Thanks, hsamson

Approved Answer

Reply to: Forcing a defined order for documents

0 votes
You can definitely set the order of signing for your documents. Below is a sample code on how you would go about setting the document workflow:
      //create a packageId using you packageId string
      PackageId packageId = new PackageId("d9355f04-9bb2-4219-b9fa-734f2650a939");
    	
    	//get your package
    	DocumentPackage myPackage = eslClient.getPackage(packageId);
    	
    	myPackage.getDocument("First Document").setIndex(2);
        myPackage.getDocument("Second Document").setIndex(1);
        
        eslClient.getPackageService().orderDocuments(myPackage);
Haris Haidary OneSpan Technical Consultant

Reply to: Forcing a defined order for documents

0 votes
So, if I am adding all documents in the DocumentPackage builder, I could just use .setIndex(#) in the DocumentBuilder section?

Reply to: Forcing a defined order for documents

0 votes
In that case, you would be using .atIndex(#) :)
Haris Haidary OneSpan Technical Consultant

Reply to: Forcing a defined order for documents

0 votes
Just noticed that, right before you posted back. Thanks!

Reply to: Forcing a defined order for documents

0 votes
Does this functionality exist in the .Net SDK or in the REST API? I need to do the same thing. I don't see a setIndex call. Also,is the document index 0 based or 1 based? Thanks Colleen

Reply to: Forcing a defined order for documents

0 votes
Hey Colleen, here's how you would do it with the .NET SDK:
       PackageId packageId = new PackageId("76fe358e-63c8-411b-928f-207955d8794a");
        DocumentPackage package = eslClient.GetPackage(packageId);

        package.GetDocument("doc_name_1").Index = 1;
        package.GetDocument("doc_name_2").Index = 0;

        eslClient.PackageService.OrderDocuments(package);
Also indexing starts at 0. In the REST API, you will need to define "index" for each document object:
{
  "documents": [
    {
      "approvals": [],
      "extract": false,
      "id": "22487880dc89cc47",
      "index": 0,
      "name": "Form"
    },
    {
      "approvals": [],
      "extract": false,
      "id": "82b3c872a5681d25",
      "index": 1,
      "name": "doc1"
    }
  ]
}
Haris Haidary OneSpan Technical Consultant

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off