Completion Report

This guide shows you how to retrieve the completion report.

The completion report contains information about your senders and the associated packages with the specified package status.

The Code

You can retrieve the completion report using the OneSpan Sign ReportService. You will need to pass as parameters the package status and the date range you want to retrieve.

// Download the completion report for all senders
CompletionReport sdkCompletionReport = eslClient.getReportService().downloadCompletionReport(PackageStatus.DRAFT, from, to);

if (sdkCompletionReport == null) {
	System.out.println("\nNo packages in DRAFT folder");
} else {
	// Display package id and name of packages in DRAFT from sender
    System.out.println();
    for(SenderCompletionReport senderCompletionReport : sdkCompletionReport.getSenders()) {
        System.out.print("Sender: " + senderCompletionReport.getSender().getEmail());
        System.out.println(" has " + senderCompletionReport.getPackages().size() + " packages in DRAFT");
 
            for (PackageCompletionReport packageCompletionReport : senderCompletionReport.getPackages()) {
                System.out.println(packageCompletionReport.getId() + " , " + packageCompletionReport.getName() + " , Sender : " + eslClient.getPackage(new PackageId(packageCompletionReport.getId())).getSenderInfo().getEmail());
        }
    }
}

The sample code above will loop through each sender completion report and print out to the console: the sender email, the number of packages in DRAFT, and the package id and name of every package in DRAFT.

You can also download the completion report as CSV format:

String sdkCompletionReportCSV = eslClient.getReportService().downloadCompletionReportAsCSV(PackageStatus.DRAFT, from, to);

Running Your Code

Below is a screenshot of the console output you can expect once you’ve run your code.

completionreport

Get the Code

The completion report contains information about your senders and the associated packages with the specified package status.

The Code

You can retrieve the completion report using the OneSpan Sign ReportService. You will need to pass as parameters the package status and the date range you want to retrieve.

// Download the completion report for all senders
CompletionReport sdkCompletionReport = eslClient.ReportService.DownloadCompletionReport(PackageStatus.DRAFT, from, to);

if (sdkCompletionReport == null) {
   Debug.WriteLine("\nNo packages in DRAFT folder");
} else {
    // Display package id and name of packages in DRAFT from sender
    Debug.WriteLine("");
    foreach (SenderCompletionReport senderCompletionReport in sdkCompletionReport.Senders) {
        Debug.WriteLine("Sender: " + senderCompletionReport.Sender.Email);
        Debug.WriteLine(" has " + senderCompletionReport.Packages.Count + " packages in DRAFT");
 
                foreach (PackageCompletionReport packageCompletionReport in senderCompletionReport.Packages) {
                   Debug.WriteLine(packageCompletionReport.Id + " , " + packageCompletionReport.Name + " , Sender : " + eslClient.GetPackage(new PackageId(packageCompletionReport.Id)).SenderInfo.Email);
        }
    }
}

The sample code above will loop through each sender completion report and print out to the console: the sender email, the number of packages in DRAFT, and the package id and name of every package in DRAFT.

You can also download the completion report as CSV format:

String sdkCompletionReportCSV = eslClient.ReportService.DownloadCompletionReportAsCSV(PackageStatus.DRAFT, from, to);

Running Your Code

Below is a screenshot of the console output you can expect once you’ve run your code.

completionreport

Get the Code

The completion report contains information about your senders and the associated packages with the specified package status.

The Code

Retrieving the completion report is done with the OneSpan Sign ReportService. You will need to pass as parameters the package status and the date range you want to retrieve.

HTTP Request
GET /api/reports/completion?status={status}&from={date}&to={date}

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

Response Payload

{
  "from": "2017-11-15T00:00:00Z",
  "senders": [
    {
      "sender": {
        "status": "ACTIVE",
        "language": "en",
        "signature": {
          "handdrawn": "AQAAADJI+a4cnf0t3Dlf0GqWJceCA+4AAwADAN8BAAADAAAAggPuAOgAAAACfyxAUkAlQCdAOUA6QDtAHEAtQBtACkAJQBVAFBIyfkA0QBVABkAYQCpAHEAtQC9ALkAtQDxAO0A6QEhAN0AlQCQyTjZAgEBwQIBAoFDSUOFQ8lDiUNJQ0lCiQHBAUCIXGVBSUCVQN1BJUDpQXVA9UE5QLlAuUDpQOVAkm1BhQLZAd0B7QFpAXUBPQTBAHkAdQAtAB2AmYBRgQmCAcJVwmHC5Mh42QFBAkECAQKBAsEDAQNBQ8VDyUPJQ81DTULRQg1ByUEGeIgQ6QDhAJ0AmQCZAFItwbHBtMhdBUCafUGJQcVCSUJFQoUDAQKBAsECBQHNAdEBEQDRABkAFYCdgR2BXYHhgd2CIYIVgdmBDYEJAUUBwQIFAkECwQLBA0EDAQLBAoEBwQGASG0xAc0BnQEhASkArQBxADEAKQAlABkAFMkVKUENQUVBBUGFQYVCRUKJQsVDCUNJQsUDQQKBAkEBwQFJAREAlIllVUHFQUVByUKFQslDSUNJQ9VDlUPZQ1lDWUKVQZVBEUCQyCxivr2BjYGRgdGB1YHZgZmBWYEdgRkAFQClAREBjQJNAk0CzQKNAs0CjQJNAQo9gRWBjYJNgs2DCYNRg1GCkYKRgY2Bkrg==",
          "textual": null
        },
        "id": "ZQI8k6faVoM8",
        "data": {
          "serviceCredentials": "{}",
          "showIntro": false
        },
        "account": null,
        "title": null,
        "external": null,
        "updated": "2016-05-05T19:30:13Z",
        "memberships": [],
        "phone": "+1 201-555-5555",
        "professionalIdentityFields": [],
        "userCustomFields": [
          {
            "id": "policy_number_id",
            "data": null,
            "translations": [
              {
                "description": "Car Insurance Policy Number.",
                "language": "en",
                "id": "",
                "data": null,
                "name": "Policy Number"
              }
            ],
            "value": "",
            "name": ""
          }
        ],
        "locked": null,
        "activated": null,
        "company": "eSignLive",
        "email": "harishaidary@mailinator.com",
        "firstName": "Haris",
        "lastName": "Haidary",
        "type": "MANAGER",
        "name": "",
        "address": null,
        "created": "2016-05-05T19:30:13Z",
        "specialTypes": [],
        "hasDelegates": false
      },
      "packages": [
        {
          "status": "DRAFT",
          "id": "J5Hk-r1nLXx7HIHGcmAGdQGdNI0=",
          "data": {
            "origin": "api"
          },
          "documents": [
            {
              "id": "contract",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "name": "Sample Contract"
            }
          ],
          "trashed": false,
          "updated": "2017-11-16T16:53:01Z",
          "created": "2017-11-16T15:38:34Z",
          "name": "PHP Application Example",
          "signers": [
            {
              "id": "Signer1",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "lastName": "Smith",
              "email": "mail72@mailinator.com",
              "firstName": "John"
            },
            {
              "id": "ZQI8k6faVoM8",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "lastName": "Haidary",
              "email": "harishaidary@mailinator.com",
              "firstName": "Haris"
            },
            {
              "id": "Sender1",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "lastName": "Smith",
              "email": "mail71@mailinator.com",
              "firstName": "Mike"
            },
            {
              "id": "Signer5",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "lastName": "Smith",
              "email": "mail32@mailinator.com",
              "firstName": "John"
            }
          ]
        },
        {
          "status": "DRAFT",
          "id": "aJK-4tCe5YQN6K2VDAOQk94jnLA=",
          "data": {
            "senderVisible": false
          },
          "documents": [],
          "trashed": false,
          "updated": "2017-11-16T15:16:04Z",
          "created": "2017-11-16T15:15:42Z",
          "name": "test",
          "signers": [
            {
              "id": "ZQI8k6faVoM8",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "lastName": "Haidary",
              "email": "harishaidary@mailinator.com",
              "firstName": "Haris"
            }
          ]
        },
        {
          "status": "OPTED_OUT",
          "id": "r1KxVEVhWgnKVZMYkjJR9I6fqjY=",
          "data": {
            "sdk": "Java v11.8",
            "origin": "api"
          },
          "documents": [
            {
              "id": "aee1629e700a37ded7d4e6a9e32335447f8db6fd79bf74e6",
              "firstSigned": null,
              "lastSigned": null,
              "completed": false,
              "name": "test doc"
            }
          ],
          "trashed": false,
          "updated": "2017-11-15T17:49:37Z",
          "created": "2017-11-15T16:13:52Z",
          "name": "Package with Initials and Fullname",
          "signers": [
            {
              "id": "Signer1",
              "firstSigned": null,
              "lastSigned": null,
              "completed": false,
              "lastName": "Smith",
              "email": "mail32@mailinator.com",
              "firstName": "John"
            },
            {
              "id": "ZQI8k6faVoM8",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "lastName": "Haidary",
              "email": "harishaidary@mailinator.com",
              "firstName": "Haris"
            }
          ]
        },
        {
          "status": "DRAFT",
          "id": "wkfRigOpypHA2q1HLpHiaTLjoMc=",
          "data": {
            "sdk": "Java v11.8",
            "origin": "api"
          },
          "documents": [
            {
              "id": "5e7c8c233a647df3e61a9d4864f7ebca5fe0f8feeb9b7a72",
              "firstSigned": null,
              "lastSigned": null,
              "completed": false,
              "name": "test doc"
            }
          ],
          "trashed": false,
          "updated": "2017-11-15T16:21:23Z",
          "created": "2017-11-15T16:21:21Z",
          "name": "Package with Initials and Fullname",
          "signers": [
            {
              "id": "ZQI8k6faVoM8",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "lastName": "Haidary",
              "email": "harishaidary@mailinator.com",
              "firstName": "Haris"
            },
            {
              "id": "Signer1",
              "firstSigned": null,
              "lastSigned": null,
              "completed": false,
              "lastName": "Smith",
              "email": "mail32@mailinator.com",
              "firstName": "John"
            }
          ]
        },
        {
          "status": "DRAFT",
          "id": "2xMXp-Wu3xDTXmhW7ao4Wmdex9Q=",
          "data": {
            "sdk": "Java v11.8",
            "origin": "api"
          },
          "documents": [
            {
              "id": "8a2f453faf1da30818dc0c7ee9302eb7f2362638bbd76e77",
              "firstSigned": null,
              "lastSigned": null,
              "completed": false,
              "name": "test doc"
            }
          ],
          "trashed": false,
          "updated": "2017-11-15T16:20:13Z",
          "created": "2017-11-15T16:20:11Z",
          "name": "Package with Initials and Fullname",
          "signers": [
            {
              "id": "Signer1",
              "firstSigned": null,
              "lastSigned": null,
              "completed": false,
              "lastName": "Smith",
              "email": "mail32@mailinator.com",
              "firstName": "John"
            },
            {
              "id": "ZQI8k6faVoM8",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "lastName": "Haidary",
              "email": "harishaidary@mailinator.com",
              "firstName": "Haris"
            }
          ]
        }
      ]
    }
  ],
  "to": "2017-11-17T00:00:00Z"
}

You can also retrieve the completion report as CSV format by setting the “Accept” header to “text/csv”:

GET https://sandbox.esignlive.com/api/reports/completion

Running Your Code

Below is a screenshot of the console output you can expect once you’ve run your code.

completionreport

Get the Code

The completion report contains information about your senders and the associated packages with the specified package status.
To notice, some of the code is an extension of the APEX SDK and can be gotten through this Code Share.

The Code

The function allowing you to retrieve the completion report is encapsulated like below:

public TestCompletionReport.CompletionReport downloadCompletionReport(ESignLiveAPIObjects.PackageStatus packageStatus, String from_x, String to, String senderId)

You will need to pass as parameters the package status, the date range you want to retrieve in the format of “yyyy-mm-dd” and the sender ID in order to associate completion report to specific sender (if sender ID is set to null, it will return completion report including all senders).

TestCompletionReport.CompletionReport completionReport = downloadCompletionReport(ESignLiveAPIObjects.PackageStatus.SENT,'2018-10-01',null,null);
for(TestCompletionReport.SenderCompletionReport senderCompletionReport: completionReport.senders){
	System.debug('Sender: ' + senderCompletionReport.sender.email + ' has ' + senderCompletionReport.packages.size() + ' packages in SENT');
	for (TestCompletionReport.PackageCompletionReport packageCompletionReport : senderCompletionReport.packages) {
                System.debug('package id: ' + packageCompletionReport.id + ' , package name: ' + packageCompletionReport.name );
        }
}

The sample code above will loop through each sender completion report and print out to the console: the sender email, the number of packages in SENT, and the package id and name of every package in SENT.

You can also download the completion report as CSV format with below encapsulated function:

public Blob downloadCompletionReportAsCSV(ESignLiveAPIObjects.PackageStatus packageStatus, String from_x, String to, String senderId)

Running Your Code

Below is a screenshot of the console output you can expect once you’ve run your code.

Capture

Get the Code