--- title: "Usage Report" slug: "usage-report" updated: 2024-10-10T13:35:17Z published: 2024-10-10T13:35:17Z canonical: "docs.onespan.com/usage-report" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.onespan.com/llms.txt > Use this file to discover all available pages before exploring further. # Usage Report [Java SDK](/v1/docs/usage-report#java-sdk) [.NET SDK](/v1/docs/usage-report#net-sdk) [REST API](/v1/docs/usage-report#rest-api) ## Java SDK To download the full code sample see our [Code Share](https://community.onespan.com/documentation/onespan-sign/codeshare/usage-report-java-sdk/) 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. ```java // Download the usage report for the specified date range 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. ```java // Get the list of sender usage reports List senderReports = report.getSenderUsageReports(); for (SenderUsageReport senderReport : senderReports) {    // Print the sender's name    System.out.println("\nSender \"" + senderReport.getSender().getFirstName() + " " + senderReport.getSender().getLastName() + "\" has: \n");    // Get the usage report categories and their counts    EnumMap usageReportCategory = senderReport.getCountByUsageReportCategory();    Iterator enumKeySet = usageReportCategory.keySet().iterator();    // Iterate through the usage report categories and print the counts    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: ```java // Download the usage report as a CSV for the specified date range String reportCSV = client.getReportService().downloadUsageReportAsCSV(from, to); ``` ![](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/image(7).png?sv=2026-02-06&spr=https&st=2026-11-04T07%3A32%3A26Z&se=2026-11-04T08%3A32%3A26Z&sr=c&sp=r&sig=UWq%2FSWExwXeEFcv9VYBpGFwrbWNMlZbTLSCw30i%2B1w0%3D) ### Results Here is an example of what you can expect to see once you have run your code. ![](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/image(9).png?sv=2026-02-06&spr=https&st=2026-11-04T07%3A32%3A26Z&se=2026-11-04T08%3A32%3A26Z&sr=c&sp=r&sig=UWq%2FSWExwXeEFcv9VYBpGFwrbWNMlZbTLSCw30i%2B1w0%3D) ## .NET SDK To download the full code sample see our [Code Share](https://community.onespan.com/documentation/onespan-sign/codeshare/usage-report-net-sdk/) 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. ```csharp 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. ```csharp // Get the list of sender usage reports IList senderReports = report.SenderUsageReports; foreach (SenderUsageReport senderReport in senderReports) {    // Print the sender's name    Debug.WriteLine("\nSender \"" + senderReport.Sender.FirstName + " " + senderReport.Sender.LastName + "\" has: \n");    // Get the usage report categories and their counts    IDictionary usageReportCategory = senderReport.CountByUsageReportCategory;    IEnumerator> enumKeySet = usageReportCategory.GetEnumerator();    // Iterate through the usage report categories and print the counts    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: ```csharp // Download the usage report as a CSV for the specified date range 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. ![](https://cdn.document360.io/038f59a7-abd0-4c14-9de7-3434d28b49fd/Images/Documentation/image(8).png?sv=2026-02-06&spr=https&st=2026-11-04T07%3A32%3A26Z&se=2026-11-04T08%3A32%3A26Z&sr=c&sp=r&sig=UWq%2FSWExwXeEFcv9VYBpGFwrbWNMlZbTLSCw30i%2B1w0%3D) ## REST API To download the full code sample see our [Code Share](https://community.onespan.com/documentation/onespan-sign/codeshare/usage-report-rest-api/) 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 ```http GET /api/reports/usage?from={date}&to={date} ``` #### HTTP Headers ```http 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 ```json {  "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": "harishaidary@example.com",        "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": "price9872@gmail.com",        "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+cFFwQWBQrwJBF1Bz ``` You can also download the usage report in CSV format by setting the Accept header to text/csv.