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

The Usage Report displays, for each sender, the number of packages that are in each possible state (for example, DRAFT, SENT, COMPLETED).

Retrieving a Usage Report

You can retrieve the Usage Report by using the OneSpan Sign ReportService. You will need the date range you want to retrieve.

 UsageReport report = client.getReportService().downloadUsageReport(from, to); 

Sender Usage Reports are returned to you as a list. You will need to loop through each individual sender usage report. To do so, an iterator is used to retrieve the number of packages in each package status within your date range. Also, for each sender usage report, the first name and last name is outputted to the console.

 List<SenderUsageReport> senderReports = report.getSenderUsageReports();   for(SenderUsageReport senderReport : senderReports) {   System.out.println("\nSender \"" + senderReport.getSender().getFirstName() + " " + senderReport.getSender().getLastName() + "\" has: \n");   EnumMap<UsageReportCategory, Integer> usageReportCategory = senderReport.getCountByUsageReportCategory();   Iterator<UsageReportCategory> enumKeySet = usageReportCategory.keySet().iterator();   while(enumKeySet.hasNext()){   UsageReportCategory currentUsageReportCategory = enumKeySet.next();   System.out.println(usageReportCategory.get(currentUsageReportCategory) + " packages in " + currentUsageReportCategory + " status");   }   } 

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

 String reportCSV = client.getReportService().downloadUsageReportAsCSV(from, to); 

Results

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

Capture

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

The Usage Report displays, for each sender, the number of packages that are in each possible state (for example, DRAFT, SENT, COMPLETED).

Retrieving a Usage Report

You can retrieve the Usage Report by using the OneSpan Sign ReportService. You will need the date range you want to retrieve.

 UsageReport report = client.ReportService.DownloadUsageReport(from, to); 

Sender Usage Reports are returned to you as a list. You will need to loop through each individual sender Usage Report. To do so, an iterator is used to retrieve the number of packages in each package status within your date range. Also, for each sender usage report, the first name and last name is outputted to the console.

 IList<SenderUsageReport> senderReports = report.SenderUsageReports;   foreach (SenderUsageReport senderReport in senderReports)   {   Debug.WriteLine("\nSender \"" + senderReport.Sender.FirstName + " " + senderReport.Sender.LastName + "\" has: \n");   IDictionary<UsageReportCategory, int> usageReportCategory = senderReport.CountByUsageReportCategory;   IEnumerator<KeyValuePair<UsageReportCategory, int>> enumKeySet = usageReportCategory.GetEnumerator();   while (enumKeySet.MoveNext())   {   Debug.WriteLine(enumKeySet.Current.Value + " packages in " + enumKeySet.Current.Key + " status");   }   } 

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

 string reportCSV = client.ReportService.DownloadUsageReportAsCSV(from, to); 

Results

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

Capture

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

The Usage Report displays, for each sender, the number of packages that are in each possible state (for example, DRAFT, SENT, COMPLETED).

Retrieving a Usage Report

Retrieving a usage report is done by making the following request:

HTTP Request

GET /api/reports/usage?from={date}&to={date}

HTTP Headers

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

You will need to pass as parameters the date range you want to retrieve. Then, you will need to loop through each individual sender usage report in the JSON response in order to retrieve the number of packages in each package status. In the sample code below, an iterator is used to loop through the JSON response.

Response Payload

 {   "from": "2017-11-17T00: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": "[email protected]",   "firstName": "Haris",   "lastName": "Haidary",   "type": "MANAGER",   "name": "",   "address": null,   "created": "2016-05-05T19:30:13Z",   "specialTypes": [],   "hasDelegates": false   },   "packages": {   "draft": 1   }   },   {   "sender": {   "status": "ACTIVE",   "language": "en",   "signature": {   "handdrawn": "AQAAAMNxCV9Bvmy34F4trFmJ21OCA+4AAwADAFgBAAADAAAAggPuAKQAAAACdSdASkGLQB9BAEEYQAhgFWAUEhF8j0CNQZ9BMUJAQCxAJzJLK0B0QIFAwlQCVEJUVFgHUPNQgTIKNGCEYGdgfGCOYFthR2FEQUhAiUDnRCJUgVRHVZRRslFGUQZxonUAdFp0RGSRYOhgm2BeYD9APEDHQJFQcRJQPEBJQCtBIUElQnRBMkAsQCVQYVB2ULVQ1VD0UOZUpUDTQLFAUUA0MH5QC1AfUC5RI1FBUuZQSFSBQYBBZUFjQU1BAEAsQCdgJHDIcGQyUBxAgEDQUPFUQlRhVHNUElD2UHKbMgYtQGFA4FChVGJYhFSEVBFQcUAGYEpgrGCpYMdgtWD3YIRgZGBCYEMyMzSPQEJAaECoQIZAhUCFQMhAVo4iFA+vYDlgKUAXQHRAg1QGUEVQR3A2cIhw13DEcMFgYmBEYCpACEBFQIdAhECRUHFQQw==",   "textual": null   },   "id": "E5b38STIWcMI",   "data": {   "serviceCredentials": "{}",   "showIntro": false   },   "account": null,   "title": null,   "external": null,   "updated": "2016-05-10T14:24:46Z",   "memberships": [],   "phone": "",   "professionalIdentityFields": [],   "userCustomFields": [],   "locked": null,   "activated": null,   "company": "ESIGN",   "email": "[email protected]",   "firstName": "Johnny",   "lastName": "Cash",   "type": "REGULAR",   "name": "",   "address": null,   "created": "2016-05-10T14:24:46Z",   "specialTypes": [],   "hasDelegates": false   },   "packages": {}   },   {   "sender": {   "status": "ACTIVE",   "language": "en",   "signature": {   "handdrawn": "AQAAANJsTUwxfNU+Ldhp6TyKit+CA+4AAwADAPYCAAADAAAAggPuAH4BAAACeCZgFUAHQAhABUAGQAdAB2AZYChgGGAZQAlACkAIQAlAB2AVQAcSC4JANEAVQAVAFUAXQAZAJkAWQCdARkA0QESOQGNAYUBxQIBAgECAUIJQc1BkUFVQVlA4UClQGVAIUAdwFnAVu3AkvmBQYENgRWA3YCpgLGA+YC5gLWAdQAtACUAIQAZAJUA2j0BBn1AFUBZQBxIUOFAlUDSbUFaeUEJQYVBhQHBAkEC2QLdAyUC5QIhAd0BGQBVABUAFYDVgZmBkYIVghWB0YJVgY2B0YHJgUmBBYGFwgr9wRHBEcEVwNXA0cDVwF1AHUCSfUERQU1BSUEFQoUBgQHBAkUByQJNAg0CCQHJAUkBRQIBAcFBSUEJQRJtQBTIVOUAkQCZAN0BJQDhAW0BaQFpASUBZQEdAJkAkQCRQBnA1cDZwVnBncGdwZ3BWcDVwNnAmcBVQBlAFUCZQJJ9QRFBEUGNQUlBSUFFQUlBhAhAZQAhACEAJQCdANkA0QFRAgUBgQGBAYFBzUGRQdlBHUDpQKFAZUAlQB1AGcCVwNGBRQApACUAaQExAG0BNQE1ATUBrQHpAiEB0QHRAU45gkGBwYIFgwGDQYOBkAGQCYOJg4mChYJJgYGBwcEK/cCSbUGJQQVBBErB7QAhAFkAYQCpAGEAaQClAGkAZQBdAJ0AFQBQSAnaeQIBAskCCQINAs0CkQKNAtUCkQKVAlECVQHVAdkBUQEZAJEAGQAVAB2A2YFZgdmCVYKVgtGC1YMNgw2CyYMFgoWCgYJBgcGBwYGBgUHBxcEESsjRgcGBRYFSvYDRgJWAnYBZAB0AGQBhANI9AREBSQGFAYEBgQFBQUlBTn1BEUBRQBVAGcBVwNnA1cDRwNHBFcES/cEK+cFFwQWBQrwJBF1BzUENQQlBDn1BDn5tQJHAkcHFgYGBgYGBgUGBQYEKvr2AmQAdABkAmj0BEQFJAYkBxQHJAgUCBQHBAcEBwQGBAUEBQQIBAcA==",   "textual": null   },   "id": "rNs5hVUQ0mQY",   "data": {   "serviceCredentials": "{}",   "showIntro": true   },   "account": null,   "title": null,   "external": null,   "updated": "2016-05-10T14:24:55Z",   "memberships": [],   "phone": "",   "professionalIdentityFields": [],   "userCustomFields": [],   "locked": null,   "activated": null,   "company": "eSignLive",   "email": "[email protected]",   "firstName": "Mary",   "lastName": "Doe",   "type": "MANAGER",   "name": "",   "address": null,   "created": "2016-05-10T14:24:56Z",   "specialTypes": [],   "hasDelegates": false   },   "packages": {}   },   {   "sender": {   "status": "ACTIVE",   "language": "en",   "signature": null,   "id": "FxktNzFzmkIY",   "data": {   "hasNotCreatedATransaction": true,   "showIntro": true   },   "account": null,   "title": null,   "external": null,   "updated": "2017-10-23T21:26:54Z",   "memberships": [],   "phone": "",   "professionalIdentityFields": [],   "userCustomFields": [],   "locked": null,   "activated": null,   "company": "esl",   "email": "[email protected]",   "firstName": "Max",   "lastName": "Domi",   "type": "REGULAR",   "name": "",   "address": null,   "created": "2017-10-23T21:26:55Z",   "specialTypes": [],   "hasDelegates": false   },   "packages": {}   },   {   "sender": {   "status": "ACTIVE",   "language": "en",   "signature": null,   "id": "IBCyHvarzWsX",   "data": {   "hasNotCreatedATransaction": true,   "showIntro": true   },   "account": null,   "title": null,   "external": null,   "updated": "2017-11-13T15:07:49Z",   "memberships": [],   "phone": "",   "professionalIdentityFields": [],   "userCustomFields": [],   "locked": null,   "activated": null,   "company": "",   "email": "[email protected]",   "firstName": "Peter",   "lastName": "Pan",   "type": "REGULAR",   "name": "",   "address": null,   "created": "2017-11-13T15:07:49Z",   "specialTypes": [],   "hasDelegates": false   },   "packages": {}   },   {   "sender": {   "status": "ACTIVE",   "language": "en",   "signature": null,   "id": "2q37oSloj5AD",   "data": {   "hasNotCreatedATransaction": true,   "showIntro": true   },   "account": null,   "title": null,   "external": null,   "updated": "2017-11-13T15:07:49Z",   "memberships": [],   "phone": "",   "professionalIdentityFields": [],   "userCustomFields": [],   "locked": null,   "activated": null,   "company": "",   "email": "[email protected]",   "firstName": "Mike",   "lastName": "Tango",   "type": "REGULAR",   "name": "",   "address": null,   "created": "2017-11-13T15:07:50Z",   "specialTypes": [],   "hasDelegates": false   },   "packages": {}   },   {   "sender": {   "status": "ACTIVE",   "language": "en",   "signature": null,   "id": "bg65Jj1lR0Y5",   "data": {   "hasNotCreatedATransaction": true,   "showIntro": true   },   "account": null,   "title": null,   "external": null,   "updated": "2017-11-13T15:07:50Z",   "memberships": [],   "phone": "",   "professionalIdentityFields": [],   "userCustomFields": [],   "locked": null,   "activated": null,   "company": "",   "email": "[email protected]",   "firstName": "John",   "lastName": "Smith",   "type": "REGULAR",   "name": "",   "address": null,   "created": "2017-11-13T15:07:50Z",   "specialTypes": [],   "hasDelegates": false   },   "packages": {}   }   ],   "to": "2017-11-17T20:12:40Z"   } 

You can also download the usage report in CSV format by setting the Accept header to text/csv.