mbilensky | Posts: 52

Updating signatures per Package instead of per Document

0 votes
Hi, I'm looking for a way to add signatures to multiple documents in package in one API call instead of having to make separate calls for each individual document. We're looking to accomplish this so that we can reduce our total number of API calls to eSignLive and help our performance. Ideally the code below would run successfully, but unfortunately the updatePackage call does not affect the signatures within the documents and the second set of asserts all fail.
    Assert.assertTrue(documentPackage.getDocuments().get(1).getSignatures().isEmpty());
    Assert.assertTrue(documentPackage.getDocuments().get(2).getSignatures().isEmpty());
    Assert.assertTrue(documentPackage.getDocuments().get(3).getSignatures().isEmpty());
    
    documentPackage.getDocuments().get(1).addSignatures(signatures);
    documentPackage.getDocuments().get(2).addSignatures(signatures);
    documentPackage.getDocuments().get(3).addSignatures(signatures);
    
    eslClient.updatePackage(documentPackage.getId(), documentPackage);
    documentPackage = eslClient.getPackage(documentPackage.getId());
    
    Assert.assertFalse(documentPackage.getDocuments().get(1).getSignatures().isEmpty());
    Assert.assertFalse(documentPackage.getDocuments().get(2).getSignatures().isEmpty());
    Assert.assertFalse(documentPackage.getDocuments().get(3).getSignatures().isEmpty());
Is there some other call in the SDK that can accomplish this? Thanks.

Duo_Liang | Posts: 3776

Reply to: Updating signatures per Package instead of per Document

0 votes
Hi mbilensky, If you add the approvals to the Document SDK object before uploading the document(s), you won't have to make multiple calls. Is there a reason you're waiting til after uploading the documents to add the approvals? Duo

mbilensky | Posts: 52

Reply to: Updating signatures per Package instead of per Document

0 votes
Hi Duo, I don't think that will work for us since we need the Documents numberOfPages field to perform some validations prior to adding the signatures and it is only populated after uploading the document and converted to a pdf as we are uploading docx files and the length of the file may change after the conversion. Is there any other way to accomplish this? Thanks.

Duo_Liang | Posts: 3776

Reply to: Updating signatures per Package instead of per Document

0 votes
Hi mbilensky, If your concern is, you can't make sure (1) how many pages the converted PDF contains(not sure how many approvals to input) or (2) the page layout depending on the converted PDF(not sure about the location and the size of the signature box). We suggest to use the Text Tag Feature. The idea behind this feature is to use ESL grammar tags in your document to tell OneSpan Sign where/size and what type of fields you want to embed into your PDF. In this way, you don't need to add approvals one by one. Hope this could help you! Duo

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