diff --git a/README.md b/README.md index f9a7ca2..ba4b0a2 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,19 @@ public class FingerprintApiExample { System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); } + // Search events with custom filters + try { + // By visitorId + EventsGetResponse response = api.searchEvents(LIMIT, FPJS_VISITOR_ID, null, null, null, null, null, null, null); + // Bad bot + // EventsGetResponse response = api.searchEvents(LIMIT, null, "bad", null, null, null, null, null, null); + // Filtered by IP + // EventsGetResponse response = api.searchEvents(LIMIT, null, null, "192.168.0.1/32", null, null, null, null, null); + System.out.println(response.getProducts().toString()); + } catch (ApiException e) { + System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); + } + // Update an event with a given requestId try { EventsUpdateRequest request = new EventsUpdateRequest(); diff --git a/examples/src/main/java/com/fingerprint/example/FunctionalTests.java b/examples/src/main/java/com/fingerprint/example/FunctionalTests.java index c8313a3..9800159 100644 --- a/examples/src/main/java/com/fingerprint/example/FunctionalTests.java +++ b/examples/src/main/java/com/fingerprint/example/FunctionalTests.java @@ -42,6 +42,15 @@ public static void main(String... args) { System.exit(1); } + // Search events + try { + final Object events = api.searchEvents(2, null, "bad", null, null, null, null, null, null); + System.out.println(events); + } catch (ApiException e) { + System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage()); + System.exit(1); + } + // Update identification event if (FPJS_REQUEST_ID_TO_UPDATE != null) { diff --git a/template/README.mustache b/template/README.mustache index 3c65be9..a9060ea 100644 --- a/template/README.mustache +++ b/template/README.mustache @@ -179,6 +179,19 @@ public class FingerprintApiExample { System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); } + // Search events with custom filters + try { + // By visitorId + EventsGetResponse response = api.searchEvents(LIMIT, FPJS_VISITOR_ID, null, null, null, null, null, null, null); + // Bad bot + // EventsGetResponse response = api.searchEvents(LIMIT, null, "bad", null, null, null, null, null, null); + // Filtered by IP + // EventsGetResponse response = api.searchEvents(LIMIT, null, null, "192.168.0.1/32", null, null, null, null, null); + System.out.println(response.getProducts().toString()); + } catch (ApiException e) { + System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); + } + // Update an event with a given requestId try { EventsUpdateRequest request = new EventsUpdateRequest();