Getting a workgroup activity report

Use getAuditEvents to customize and get a report of audit events for signing activities performed by the user and client authentication certificates issued by the user.

Java
//add your client certificate
		System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
	    System.setProperty("javax.net.ssl.keyStore", "C:\\\\Program Files\\\\Java\\\\jdk1.8.0_25\\\\bin\\\\sas_keystore.p12");
		System.setProperty("javax.net.ssl.keyStorePassword", "yourPassword");
    	
        //specify your partner code, username, and password		
        AuthToken  authToken =  new AuthToken();
        AuthToken authToken = new AuthToken();
        authToken.setPartnerCode("partner code");
		authToken.setUserName("user name");
		authToken.setPassword("password");
       
	   // Specify the start date from which the events would be returned and it should be greater than the date when the audit event service is enabled for the customer.
        DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");        
        Date date = format.parse("YYYY-MM-DDTHH:mm:ssTimeZone");//specify the startDate 
        GregorianCalendar startDate = new GregorianCalendar();
        startDate.setTime(date);		
        AuditEventsRequestType auditEventsRequestType = new AuditEventsRequestType();
        auditEventsRequestType.setAuthToken(authToken);
        auditEventsRequestType.setPublisherID("publisherID");
        auditEventsRequestType.setStartDate(startDate);
        auditEventsRequestType.setPageNumber(1);
       
        AuditEventsResponseType response;

        try {
        	SigningProxy request = new SigningProxy();
              
            response = request.getAuditEvents(auditEventsRequestType);
            
        	//get the result code
            System.out.println("Result code: \\t" + response.getResult().getResultCode());
        	
        	 //if the request is successful with or without warnings
            if (response.getResult().getResultCode() >= 0) {
                AuditEventsDetailsType[] auditEventsDetailsList = response.getAuditEventsDetailsList();
                List<AuditEventsDetailsType> auditEventsDetails = java.util.Arrays.asList(auditEventsDetailsList);        		
                //Print success message and other details	        		
                System.out.println("Success!");
        		for( AuditEventsDetailsType eventsDetails : auditEventsDetails) {		
                System.out.println("auditEventsDetails");
                System.out.println("publisherID : " + eventsDetails.getPublisherID());
                System.out.println("timestamp : " + eventsDetails.getTimestamp().getTime());
                System.out.println("eventType : " + eventsDetails.getEventType() );
                System.out.println("subject : "  + eventsDetails.getSubject());
                System.out.println("person : "  + eventsDetails.getPerson() );
                System.out.println("ip : "  + eventsDetails.getIp() );
                System.out.println("serial : "  + eventsDetails.getSerial());
        		}
        		
           }
           else {
                //if the request failed, list any errors
                try { 
                    //list errors, if present
                	Error[] error = response.getResult().getErrors();
                    for (Error err : error) {
                        if (!err.getErrorMessage().isEmpty()) {
                            System.err.println("Warning: " + err.getErrorMessage() + " Field: " + err.getErrorField());
                        }
                    }
                  
                }
                catch (Exception e) {
                    System.out.println("Error while reading request details");
                }
            }
        }
        catch (Exception e) {}
C#
//create the service object
            SigningClient signingClient = new SigningClient();
            //add client cert for two-factor-authentication
            string clientCertPath = "C:\\\\Program Files\\\\Java\\\\jdk1.8.0_25\\\\bin\\\\sas_keystore.p12";  //specify the client cert path
            string clientCertPassword = "your password";

            X509Certificate2 clientCert = new X509Certificate2(clientCertPath, clientCertPassword);

            
            //add your username, password, and partnercode
            AuthToken authToken = new AuthToken();
            authToken.partnerCode = "partner code"; //specify the partner code
            authToken.userName = "username";  //specify the user name
            authToken.password = "password"; //specify the password
            

            // Specify the start date from which the events would be returned and it should be greater than the date when the audit event service is enabled for the customer.

            string date = "2015-09-29T18:46:19+0000"; //specify the start date in "yyyy-MM-ddTHH:mm:ssZ" format
            DateTime startDate = DateTime.Parse(date);
            AuditEventsRequestType auditEvents = new AuditEventsRequestType();
            auditEvents.authToken = authToken;
            auditEvents.publisherID = publisher id; //specify the publisher id
            auditEvents.startDate = startDate;
            auditEvents.pageNumber = 1;
            
            AuditEventsResponseType response;

            try
            {
                response = signingClient.getAuditEvents(auditEvents);

                Console.WriteLine("Result code: " + response.result.resultCode);

                if (response.result.resultCode >= 0)
                {
                    try
                    {
                        Error[] errors = response.result.errors;
                        foreach (Error error in errors)
                        {
                            if (error.errorMessage.Length > 0)
                            {
                                Console.WriteLine("Warning: " + error.errorMessage + " Field: " + error.errorField);
                            }
                        }
                    }
                    catch (Exception e) { }

                    auditEventsDetailsType[] auditEventsDetailsList = response.auditEventsDetailsList;
                    List<auditEventsDetailsType> auditEventsDetails = auditEventsDetailsList.ToList();


                    //Print success message and other details

                    Console.WriteLine("Success!");
                    foreach (auditEventsDetailsType eventsDetails in auditEventsDetails)
                    {
                        Console.WriteLine("auditEventsDetails");
                        Console.WriteLine("publisherID : " + eventsDetails.publisherID);
                        Console.WriteLine("timestamp : " + eventsDetails.timestamp);
                        Console.WriteLine("eventType : " + eventsDetails.eventType);
                        Console.WriteLine("subject : " + eventsDetails.subject);
                        Console.WriteLine("person : " + eventsDetails.person);
                        Console.WriteLine("ip : " + eventsDetails.ip);
                        Console.WriteLine("serial : " + eventsDetails.serial);
                    }
                }
                else
                {
                    try
                    {
                        //list errors, if present
                        Error[] errors = response.result.errors;
                        foreach (Error error in errors)
                        {
                            if (error.errorMessage.Length > 0)
                            {
                                Console.WriteLine("Warning: " + error.errorMessage + " Field: " + error.errorField);
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Error while reading request details: " + e.InnerException.Message);
                    }
                }
            }
            catch (Exception e) { }

We use cookies to ensure that we give you the best experience on our website. By using this site, you agree to the Terms of Service.