How do I set "Accept only" for a signer using the .NET SDK
Monday, July 10, 2023 at 03:10amIn the designer of a package, there is a checkbox "Accept only" for a signer. How can I set this to true using the .NET SDK?
In the designer of a package, there is a checkbox "Accept only" for a signer. How can I set this to true using the .NET SDK?
Reply to: How do I set "Accept only" for a signer using the .NET SDK
Tuesday, July 11, 2023 at 08:53amHi Rob,
I see your concerns. In short, try to add accept-only approval for signer1 in a separate step, see below example code:
DocumentPackage documentPackage = PackageBuilder.NewPackageNamed("Test Transaction")
.WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
.WithCustomId("Signer2")
.WithFirstName("John")
.WithLastName("Smith"))
.WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
.WithCustomId("Signer1")
.WithFirstName("John")
.WithLastName("Smith"))
.WithDocument(DocumentBuilder.NewDocumentNamed("Document1")
.WithId("Document1")
.EnableExtraction()
.WithExtractionType(ExtractionType.TEXT_TAGS)
.FromFile("...\\Example Text Tags.docx")
)
.Build();
PackageId packageId = ossClient.CreatePackageOneStep(documentPackage);
DocumentPackage createdPackage = ossClient.GetPackage(packageId);
Signature signer1Approval = SignatureBuilder.AcceptanceFor("[email protected]").Build();
ossClient.ApprovalService.AddApproval(createdPackage, "Document1", signer1Approval );
ossClient.SendPackage(packageId);
Debug.WriteLine(packageId);
Allowing a mix of signatures and accept-only is only supported in a recent release 11.50, however the SDK hasn't fully supported it yet. The above code could work it around though.
Duo
Reply to: How do I set "Accept only" for a signer using the .NET SDK
Monday, July 10, 2023 at 09:05amHi robadmiraal,
Thanks for your post! When adding signatures for signers, use SignatureBuilder.AcceptanceFor("signer_email") method instead of .SignatureFor() or .CaptureFor():
DocumentPackage documentPackage = PackageBuilder.NewPackageNamed("Test Transaction")
.WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
.WithCustomId("Signer1")
.WithFirstName("John")
.WithLastName("Smith"))
.WithDocument(DocumentBuilder.NewDocumentNamed("Document1")
.WithId("Document1")
.FromFile("...\\4contract.pdf")
.WithSignature(SignatureBuilder.AcceptanceFor("[email protected]")
)
)
.Build();
Duo
Reply to: How do I set "Accept only" for a signer using the .NET SDK
Tuesday, July 11, 2023 at 03:02amThank you for the example. This works as long as I don't use EnableExtraction WithExtractionType(ExtractionType.TEXT_TAGS).
I have a Word document without any fields for Signer1 and with a capture field fot Signer2.If I remove the EnableExtraction lines, it works as proposed (but of course without the esl caputere extracted), and the first signer is marked as "Accept only".
But when I use use EnableExtraction and WithExtractionType(ExtractionType.TEXT_TAGS), the first signer is not marked as "Accept only".
Is that a bug or am I missing something?
Reply to: How do I set "Accept only" for a signer using the .NET SDK
Thursday, July 13, 2023 at 03:36amThank you, this wordkaround works great.