Delegation Event Report

The following guide shows you how to retrieve the delegation event report.

In OneSpan Sign, you can retrieve an extensive delegation audit trail for an account. If you don’t know how to delegate access, you can follow this feature guide.

The Code

The first step is to define the date range for your report.

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

Then, you can retrieve your delegation report using the OneSpan Sign client:

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

And you can loop through each event as shown below:

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 the delegation event report as CSV format:

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

Running Your Code

Below is a screenshot of what you can expect if you run the code above:

capture

Get the Code

In OneSpan Sign, you can retrieve an extensive delegation audit trail for an account. If you don’t know how to delegate access, you can follow this feature guide.

The Code

The first step is to define the date range for your report.

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

Then, you can retrieve your delegation report using the OneSpan Sign client:

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

And you can loop through each event as shown below:

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 the delegation event report as CSV format:

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

Running Your Code

Below is a screenshot of what you can expect if you run the code above:

capture

Get the Code

In OneSpan Sign, you can retrieve an extensive delegation audit trail for an account. If you don’t know how to delegate access, you can follow this feature guide.

The Code

The first step is to define the date range for your report.

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
GET /api/reports/delegation?from={START_DATE}&to={END_DATE}

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

Response Payload

{
  "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@mailinator.com) to delegate on behalf of: Haris Haidary (mail12@mailinator.com)",
        "eventUser": "Haris Haidary (mail12@mailinator.com, from 00.00.000.000) "
      },
      {
        "eventDate": "2017-01-09T19:09:46Z",
        "eventType": "Removed all Delegates",
        "eventDescription": "Removed all delegates for: Haris Haidary (mail12@mailinator.com)",
        "eventUser": "Haris Haidary (mail12@mailinator.com, from 00.00.000.000) "
      }
    ]
  }
}

You can also download the delegation event report as CSV format by changing the “Accept” header in your request from “application/json” to “text/csv”.

Get the Code