---
title: "Delegation Event Report"
slug: "delegation-event-report"
updated: 2024-10-10T13:44:59Z
published: 2024-10-10T13:44:59Z
canonical: "docs.onespan.com/delegation-event-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.

# Delegation Event Report

[Java SDK](/v1/docs/delegation-event-report#java-sdk) [.NET SDK](/v1/docs/delegation-event-report#net-sdk) [REST API](/v1/docs/delegation-event-report#rest-api)

## Java SDK

To download the full code sample see our [Code Share](https://community.onespan.com/documentation/onespan-sign/codeshare/delegation-report-java-sdk/) site.

This topic describes how to retrieve an extensive delegation audit trail for an account in OneSpan Sign. This audit trail will provide you with complete history of any changes occurring in your account regarding delegation.

For more information, see [Delegating Access](/v1/docs/delegating-access).

To retrieve this audit trail you will need to provide a date range for the information you like to see. The following code will do this:

```java
Date START_DATE = new LocalDateTime(2016, 1, 1, 0, 0).toDate();
Date END_DATE = LocalDateTime.now().toDate();
```

Once you have done that, you can retrieve your delegation report using the OneSpan Sign client:

```java
DelegationReport report = eslClient.getReportService().downloadDelegationReport(START_DATE, END_DATE);
```

The following code will allow you to navigate through each event:

```java
Map<String, List<DelegationEventReport>> eventReport = report.getDelegationEventReports();
		
for (Entry<String, List<DelegationEventReport>> entry : eventReport.entrySet())
{   
	for (DelegationEventReport r : entry.getValue()) {
		System.out.format("Event User: %s\nEvent Date: %s\nEvent Type: %s\nEvent Description: %s\n\n", r.getEventUser(), r.getEventDate().toString(), r.getEventType(), r.getEventDescription());
	}
}
```

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

```java
String reportCSV = eslClient.getReportService().downloadDelegationReportAsCSV(START_DATE, END_DATE);
```

### 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/delegation_event_report.png)

## .NET SDK

To download the full code sample see our [Code Share](https://community.onespan.com/documentation/onespan-sign/codeshare/delegation-report-net-sdk/) site.

This topic describes how to retrieve an extensive delegation audit trail for an account in OneSpan Sign. This audit trail will provide you with complete history of any changes occurring in your account regarding delegation.

For more information, see [Delegating Access](/v1/docs/delegating-access).

To retrieve this audit trail you will need to provide a date range for the information you like to see. The following code will do this:

```csharp
DateTime from = new DateTime(2016, 1, 1);
DateTime to = DateTime.Now;
```

Once you have done that, you can retrieve your delegation report using the OneSpan Sign client:

```csharp
DelegationReport report = eslClient.ReportService.DownloadDelegationReport(from, to);
```

The following code will allow you to navigate through each event:

```csharp
IDictionary<string, IList<DelegationEventReport>> eventReport = report.DelegationEvents;
foreach (var entry in eventReport)
{
    foreach (DelegationEventReport r in entry.Value)
    {
         Debug.WriteLine("Event User: {0}\nEvent Date: {1}\nEvent Type: {2}\nEvent Description: {3}\n", r.EventUser, r.EventDate.ToString(), r.EventType, r.EventDescription);
     }
}
```

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

```csharp
string reportCSV = eslClient.ReportService.DownloadDelegationReportAsCSV(START_DATE, END_DATE);
```

### 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/delegation_event_report.png)

## REST API

To download the full code sample see our [Code Share](https://community.onespan.com/documentation/onespan-sign/codeshare/delegation-report-rest-api/) site.

This topic describes how to retrieve an extensive delegation audit trail for an account in OneSpan Sign. This audit trail will provide you with complete history of any changes occurring in your account regarding delegation.

For more information, see [Delegating Access](/v1/docs/delegating-access).

To retrieve this audit trail you will need to provide a date range for the information you like to see. The following code will do this:

```http
string START_DATE = "2016-01-01";
string END_DATE = "2017-01-09";
```

Then, you can retrieve your delegation report by making the following request:

#### HTTP Request

```http
GET /api/reports/delegation?from={START_DATE}&to={END_DATE}
```

#### HTTP Headers

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

#### Response Payload

```json
{
  "from": "2016-01-01T00:00:00Z",
  "to": "2017-01-10T00:00:00Z",
  "delegationEvents": {
    "ZQI8k6faVoM8": [
      {
        "eventDate": "2017-01-09T18:35:04Z",
        "eventType": "Updated Delegates",
        "eventDescription": "Set delegates to: John Smith (mail1@example.com) to delegate on behalf of: Haris Haidary (mail12@example.com)",
        "eventUser": "Haris Haidary (mail12@example.com, from 00.00.000.000) "
      },
      {
        "eventDate": "2017-01-09T19:09:46Z",
        "eventType": "Removed all Delegates",
        "eventDescription": "Removed all delegates for: Haris Haidary (mail12@example.com)",
        "eventUser": "Haris Haidary (mail12@example.com, from 00.00.000.000) "
      }
    ]
  }
}
```

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