Create Consent Document

This following guide shows you how to create a consent document.

A consent document is a document used to confirm that a person agrees to the terms of the consent and wishes to continue with the process. This guide shows you how to create a consent document in OneSpan Sign.

The Code

The sample code below shows you how to edit the document block in order to create a consent document. If you need a comparison to the basic document object creation or if this is the first time creating a package with the Java SDK, see this guide.

.withDocument(DocumentBuilder.newDocumentWithName("Sample consent")
           .atIndex(1)
           .fromFile("C:/Users/hhaidary/Desktop/PDFs/consent.pdf")
           .withSignature(SignatureBuilder.acceptanceFor("john.smith@mailinator.com")))

It is important to note that to use acceptance signature styles and other signature styles together in one document is not allowed. You can also replace the default OneSpan Sign consent document with your own. You will have to contact support in order to replace the default OneSpan Sign consent document.

Running Your Code

The screenshots below show you what you can expect to see from a signer’s perspective.

Capture

Once the signers have read the consent document, they either choose to accept or opt-out of the signing process.

Get the Code

A consent document is a document used to confirm that a person agrees to the terms of the consent and wishes to continue with the process. This guide shows you how to create a consent document in OneSpan Sign.

The Code

The sample code below shows you how to edit the document block in order to create a consent document. If you need a comparison to the basic document object creation or if this is the first time creating a package with the .NET SDK, see this guide.

.WithDocument(DocumentBuilder.NewDocumentNamed("Sample consent")
           .AtIndex(1)
           .FromFile(@"C:/Users/hhaidary/Desktop/PDFs/consent.pdf")
           .WithSignature(SignatureBuilder.AcceptanceFor("john.smith@mailinator.com")))

It is important to note that to use acceptance signature styles and other signature styles together in one document is not allowed. You can also replace the default OneSpan Sign consent document with your own. You will have to contact support in order to replace the default OneSpan Sign consent document.

Running Your Code

The screenshots below show you what you can expect to see from a signer’s perspective.

Capture

Once the signers have read the consent document, they either choose to accept or opt-out of the signing process.

Get the Code

A consent document is a document used to confirm that a person agrees to the terms of the consent and wishes to continue with the process. This guide shows you how to create a consent document in OneSpan Sign.

The Code

The sample code below shows you how to edit the document block in order to create a consent document. If you need a comparison to the basic document object creation or if this is the first time creating a package with the REST API, see this guide.

HTTP Request
POST /api/packages/{packageId}/documents

HTTP Headers
Accept: text/html
Content-Type: multipart/form-data
Authorization: Basic api_key

Request Payload

------WebKitFormBoundary1bNO60n7FqP5WO4t
Content-Disposition: form-data; name="file"; filename="sample-contract.pdf"
Content-Type: application/pdf

%PDF-1.5
%µµµµ
1 0 obj
<>>>
endobj.... 

------WebKitFormBoundary1bNO60n7FqP5WO4t
Content-Disposition: form-data; name="payload"

{
      "approvals": [
        {
          "role": "48d0c024-0609-4255-9087-941a66f80738"
        }
      ],
      "index": 1,
      "name": "Sample consent",
      "isConsent": true
    }

------WebKitFormBoundary1bNO60n7FqP5WO4t

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

Response Payload

{
  "status": "",
  "description": "",
  "id": "bcd15ca2c46f4dcf618d61f437a9a06d21ec7517f92484c3",
  "data": {
    "ese_document_texttag_extract_needed": "false"
  },
  "approvals": [
    {
      "id": "k1r2qMRtCsI5",
      "role": "48d0c024-0609-4255-9087-941a66f80738",
      "data": null,
      "signed": null,
      "accepted": null,
      "fields": [],
      "name": ""
    }
  ],
  "pages": [
    {
      "id": "",
      "top": 0,
      "height": 1030,
      "width": 796,
      "left": 0,
      "index": 0,
      "version": 0
    }
  ],
  "external": null,
  "extract": false,
  "signedHash": null,
  "signerVerificationToken": null,
  "index": 1,
  "fields": [],
  "name": "Sample consent",
  "size": 185808
}

It is important to note that to use acceptance signature styles and other signature styles together in one document is not allowed. You can also replace the default OneSpan Sign consent document with your own. You will have to contact support in order to replace the default OneSpan Sign consent document.

Running Your Code

The screenshots below show you what you can expect to see from a signer’s perspective.

Capture

Once the signers have read the consent document, they either choose to accept or opt-out of the signing process.

Get the Code

JSON Properties

Property Type Editable Required Default Sample Value(s)
index integer Yes No 0 0 / 1 / 2 …
name string Yes No n/a Sample Consent
isConsent boolean Yes No false true / false
approvals
role string Yes No n/a 48d0c024-0609-4255-9087-941a66f80738