Retrieve All Signatures

The following guide demonstrates how to get all signatures for a package.

Once you’ve sent your document package (transaction in the new UI) for signing, you can retrieve all signatures on a document for a signer.

The Code

You can download the complete example code from the Developer Community Code Share.

The first step is to create and send a package. 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. Once you have sent your package for signing, the next step is to retrieve your DocumentPackage object.

DocumentPackage sentPackage = client.getPackage(packageId);

Then, using OneSpan Sign’s ApprovalService, you can retrieve all signable signatures. You will have to pass the DocumentPackage object, documentId string, and signerId string as parameters.

List<Signature> signer1SignableSignatures = client.getApprovalService().getAllSignableSignatures(sentPackage, documentId, signer1Id);

Finally, you can loop through each signature to retrieve, for example, the positioning, accepted date, etc.

for (Signature signature : signer1SignableSignatures){
		System.out.println("Position of signature " + i + ": (" + signature.getX() + ", " + signature.getY() + ") on page " + signature.getPage());
		i++;
}

Running Your Code

The screenshot below shows you the result you can expect if you followed the guide. The positioning of each signer’s signature is printed to the console.

Capture

Get The Code

Once you’ve sent your document package (transaction in the new UI) for signing, you can retrieve all signatures on a document for a signer.

The Code

You can download the complete example code from the Developer Community Code Share.

The first step is to create and send a package. 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. Once you have sent your package for signing, the next step is to retrieve your DocumentPackage object.

DocumentPackage sentPackage = client.GetPackage(packageId);

Then, using OneSpan Sign’s ApprovalService, you can retrieve all signable signatures. You will have to pass the DocumentPackage object, documentId string, and signerId string as parameters.

IList<Signature> signer1SignableSignatures = client.ApprovalService.GetAllSignableSignatures(sentPackage, documentId, signer1Id);

Finally, you can loop through each signature to retrieve, for example, the positioning, accepted date, etc.

foreach (Signature signature in signer1SignableSignatures){
		Debug.WriteLine("Position of signature " + i + ": (" + signature.X + ", " + signature.Y + ") on page " + signature.Page);
			    	i++;
}

Running Your Code

The screenshot below shows you the result you can expect if you followed the guide. The positioning of each signer’s signature is printed to the console.

Capture

Get The Code

Once you’ve sent your document package (transaction in the new UI) for signing, you can retrieve all signatures on a document for a signer.

The Code

You can download the complete example code from the Developer Community Code Share.

The first step is to create and send a package. 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. Once you have sent your package for signing, the next step is to retrieve the JSON from OneSpan Sign.

HTTP Request
GET /api/packages/{packageId}/documents/{documentId}

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

Response Payload

{
    "description": "",
    "id": "ddcad715b41ed28d0d8b16580c829501f35d5ed836d800c0",
    "data": {
        "ese_document_texttag_extract_needed": "false"
    },
    "approvals": [
        {
            "id": "UMxe8ClLfEYK",
            "role": "15be0c69-b672-4314-9ffd-d3da69770caa",
            "signed": null,
            "accepted": null,
            "fields": [
                {
                    "binding": "{signer.name}",
                    "validation": null,
                    "id": "BsZv3XvmpsMH",
                    "page": 0,
                    "data": null,
                    "subtype": "LABEL",
                    "top": 500,
                    "height": 30,
                    "extractAnchor": null,
                    "width": 100,
                    "extract": false,
                    "left": 300,
                    "type": "INPUT",
                    "value": "{signer.name}",
                    "name": "Signer Name"
                },
                {
                    "binding": null,
                    "validation": null,
                    "id": "u8M589SZ2hQM",
                    "page": 0,
                    "data": null,
                    "subtype": "FULLNAME",
                    "top": 39,
                    "height": 52,
                    "extractAnchor": null,
                    "width": 235,
                    "extract": false,
                    "left": 60,
                    "type": "SIGNATURE",
                    "value": "",
                    "name": ""
                }
            ],
            "name": ""
        }
    ],
    "pages": [
        {
            "id": "",
            "top": 0,
            "height": 1030,
            "width": 796,
            "left": 0,
            "index": 0,
            "version": 0
        }
    ],
    "extract": false,
    "index": 0,
    "name": "purchase_order"
}

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

From the sample code above, you will need to pass as parameter your packageId and documentId. Then, you can loop through the approvals object to retrieve, for example, the positioning, accepted date, etc.

Running Your Code

The screenshot below shows you the result you can expect if you followed the guide. The positioning of each signer’s signature is printed to the console.

Capture

Get The Code

JSON Properties

Property Type Editable Required Default Sample Value(s)
description string Yes No n/a sample consent document
id string Yes No n/a ddcad715b41ed28d0d8b16580c829501f35d5ed836d800c0
extract boolean Yes No false true / false
index integer Yes No 0 0 / 1 / 2 …
name string Yes No n/a purchase_order
data
ese_document_texttag_extract_needed boolean Yes No false false / true
approvals
fields
subtype string Yes No n/a FULLNAME / INITIALS / CAPTURE / MOBILE_CAPTURE / LABEL / TEXTFIELD / TEXTAREA / CHECKBOX / DATE / RADIO / LIST
type string Yes No n/a SIGNATURE / INPUT
extract boolean Yes No false true / false
height integer Yes No 50 50 / 100 / 150 …
left integer Yes No 0 50 / 100 / 150 …
page integer Yes No 0 0 / 1 / 2 …
top integer Yes No 0 50 / 100 / 150 …
width integer Yes No 200 50 / 100 / 150 …
role string Yes No n/a Client1
pages
id string No No n/a n/a
top integer No No 0 n/a
height integer No No 1030 n/a
width integer No No 796 n/a
left integer No No 0 n/a
index integer No No 0 n/a
version integer No No 0 n/a