Completion Report
  • 10 Oct 2024
  • 11 Minutes à lire
  • Sombre
    Lumière
  • PDF

Completion Report

  • Sombre
    Lumière
  • PDF

The content is currently unavailable in French. You are viewing the default English version.
Résumé de l’article

Java SDK.NET SDKREST APIAPEX SDK

Java SDK

To download the full code sample see our Code Share site.

It is strongly recommended that you use a Callback Listener instead of polling for transaction statuses. The use of polling may consume unnecessary resources on both your end, and on the OneSpan Sign service.

A Completion Report contains information about your senders, their associated packages, and their package status.

Retrieving a Completion Report

You can retrieve the completion report using the OneSpan Sign ReportService. You will need 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());
        }
    }
}

This sample code will search through each sender completion report and return the following:

  • the sender email

  • the number of packages in a DRAFT status

  • the package id and the name of every package in a DRAFT status.

You can also download this report in CSV format, by using the following code:

// Download the completion report as a CSV for all senders
String sdkCompletionReportCSV = eslClient.getReportService().downloadCompletionReportAsCSV(PackageStatus.DRAFT, from, to);

Results

Here is an example of what you can expect to see once you have run your code.

.NET SDK

To download the full code sample see our Code Share site.

It is strongly recommended that you use a Callback Listener instead of polling for transaction statuses. The use of polling may consume unnecessary resources on both your end, and on the OneSpan Sign service.

A Completion Report contains information about your senders, their associated packages, and their package status.

Retrieving a Completion Report

You can retrieve the completion report using the OneSpan Sign ReportService. You will need 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);
        }
    }
}

This sample code will search through each sender completion report and return the following:

  • the sender email

  • the number of packages in a DRAFT status

  • the package id and the name of every package in a DRAFT status.

You can also download this report in CSV format, by using the following code:

// Download the completion report as a CSV for all senders
String sdkCompletionReportCSV = eslClient.ReportService.DownloadCompletionReportAsCSV(PackageStatus.DRAFT, from, to);

Results

Here is an example of what you can expect to see once you have run your code.

REST API

To download the full code sample see our Code Share site.

It is strongly recommended that you use a Callback Listener instead of polling for transaction statuses. The use of polling may consume unnecessary resources on both your end, and on the OneSpan Sign service.

A Completion Report contains information about your senders, their associated packages, and their package status.

Retrieving a Completion Report

You can retrieve the completion report using the OneSpan Sign ReportService. You will need 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@example.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@example.com",
              "firstName": "John"
            },
            {
              "id": "ZQI8k6faVoM8",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "lastName": "Haidary",
              "email": "harishaidary@example.com",
              "firstName": "Haris"
            },
            {
              "id": "Sender1",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "lastName": "Smith",
              "email": "mail71@example.com",
              "firstName": "Mike"
            },
            {
              "id": "Signer5",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "lastName": "Smith",
              "email": "mail32@example.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@example.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@example.com",
              "firstName": "John"
            },
            {
              "id": "ZQI8k6faVoM8",
              "firstSigned": null,
              "lastSigned": null,
              "completed": null,
              "lastName": "Haidary",
              "email": "harishaidary@example.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@example.com",
              "firstName": "Haris"
            },
            {
              "id": "Signer1",
              "firstSigned": null,
              "lastSigned": null,
              "completed": false,

You can also download the completion report in CSV format, by setting the Accept header to text/csv:

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

Results

Here is an example of what you can expect to see once you have run your code.

APEX SDK

To download the full code sample see our Code Share site.

It is strongly recommended that you use a Callback Listener instead of polling for transaction statuses. The use of polling may consume unnecessary resources on both your end, and on the OneSpan Sign service.

A Completion Report contains information about your senders, their associated packages, and their package status.

Retrieving a Completion Report

You can retrieve the completion report using the OneSpan SignReportService. You will need the package status, the date range you want to retrieve (yyyy-mm-dd), and the sender ID. This will associate the completion report with a specific sender. To retrieve a completion report for all senders, set the sender ID to null.

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

// Method to download the completion report
public TestCompletionReport.CompletionReport downloadCompletionReport(
    ESignLiveAPIObjects.PackageStatus packageStatus, 
    String from_x, 
    String to, 
    String senderId
) {
    // Your implementation here
}
// Download the completion report for sent packages
TestCompletionReport.CompletionReport completionReport = downloadCompletionReport(
    ESignLiveAPIObjects.PackageStatus.SENT, '2018-10-01', null, null
);

// Iterate through the sender completion reports
for (TestCompletionReport.SenderCompletionReport senderCompletionReport : completionReport.senders) {
    System.debug('Sender: ' + senderCompletionReport.sender.email + ' has ' + senderCompletionReport.packages.size() + ' packages in SENT');
    
    // Iterate through the package completion reports for each sender
    for (TestCompletionReport.PackageCompletionReport packageCompletionReport : senderCompletionReport.packages) {
        System.debug('package id: ' + packageCompletionReport.id + ' , package name: ' + packageCompletionReport.name);
    }
}

This sample code will search through each sender completion report and return the following:

  • the sender email

  • the number of packages in a SENT status

  • the package id and the name of every package in a SENT status.

You can also download this report in CSV format, by using the following code:

// Method to download the completion report as a CSV
public Blob downloadCompletionReportAsCSV(
    ESignLiveAPIObjects.PackageStatus packageStatus, 
    String from_x, 
    String to, 
    String senderId
) {
    // Your implementation here
}

Results

Here is an example of what you can expect to see once you have run your code.


Cet article vous a-t-il été utile ?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Eddy AI, facilitant la découverte de connaissances grâce à l’intelligence conversationnelle