kaysonk

Add participant to accept the document instead of signing

0 votes
Hi, I am looking for some code snippet to add a participant to just "Accept" the document instead of signing. Can anyone please give me some help? Thanks, KK

Reply to: Add participant to accept the document instead of signing

0 votes
Hi kaysonk, To create a "Consent Document", you can follow this guidance. And below is the core snippet of the code:
DocumentPackage pack = PackageBuilder.newPackageNamed("Example Consent Package")
		            .withSigner(SignerBuilder.newSignerWithEmail("your signer email")
		                .withFirstName("John")
		                .withLastName("Smith")
		                .withCustomId("signer1"))
		             .withDocument(DocumentBuilder.newDocumentWithName("Sample consent")
		                .fromFile("your file path")
		                .withSignature(SignatureBuilder.acceptanceFor("your signer email")))
		             .build();
Among them, the most important line is:SignatureBuilder.acceptanceFor("your signer email"). This is to create an approval without any fields which is equal to the request payload below:
{
   "documents":[
      {
         "approvals":[
            {
               "id":"Signature1",
               "role":"Role1",
               "name":""
            },
            {
               "id":"Signature2",
               "role":"Role2",
               "name":""
            }
         ],
         "id":"sample-contract",
         "name":"Test Document"
      }
   ],
   "status":"SENT",
   "type":"PACKAGE",
   "roles":[
      {
         "id":"Role1",
         "type":"SIGNER",
         "signers":[
            {
               "email":"[email protected]",
               "firstName":"1.firstname",
               "lastName":"1.lastname"
            }
         ],
         "name":"Role1"
      },
      {
         "id":"Role2",
         "type":"SIGNER",
         "signers":[
            {
               "email":"[email protected]",
               "firstName":"2.firstname",
               "lastName":"2.lastname"
            }
         ],
         "name":"Role2"
      }
   ],
   "name":"Example Package"
}
Hope this could help you!

Duo Liang OneSpan Evangelism and Partner Integrations Developer


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