Skip to content

OpenAPI schema sync #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chubby-ducks-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fingerprint-pro-server-api-java-sdk': minor
---

**events-search**: Add 'pagination_key' parameter
2 changes: 1 addition & 1 deletion .schema-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.2.1
v2.3.0
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,16 @@ public class FingerprintApiExample {
// Search events with custom filters
try {
// By visitorId
EventsGetResponse response = api.searchEvents(LIMIT, FPJS_VISITOR_ID, null, null, null, null, null, null, null);
SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsFilter().setVisitorId(FPJS_VISITOR_ID));
// Next page
// SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsFilter().setPaginationKey(response.getPaginationKey()).setVisitorId(FPJS_VISITOR_ID));
// Bad bot
// EventsGetResponse response = api.searchEvents(LIMIT, null, "bad", null, null, null, null, null, null);
// SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsFilter().setBot("bad"));
// Filtered by IP
// EventsGetResponse response = api.searchEvents(LIMIT, null, null, "192.168.0.1/32", null, null, null, null, null);
// SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsFilter().setIpAddress("192.168.0.1/32"));
System.out.println(response.getProducts().toString());
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage());
System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage());
}

// Update an event with a given requestId
Expand Down
23 changes: 21 additions & 2 deletions docs/FingerprintApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ public class FingerprintApiExample {

## searchEvents

> SearchEventsResponse searchEvents(limit, visitorId, bot, ipAddress, linkedId, start, end, reverse, suspect)
> SearchEventsResponse searchEvents(limit, paginationKey, visitorId, bot, ipAddress, linkedId, start, end, reverse, suspect)

Get events via search

Expand Down Expand Up @@ -418,6 +418,7 @@ public class FingerprintApiExample {
ApiClient client = Configuration.getDefaultApiClient(FPJS_API_SECRET, Region.EUROPE);
FingerprintApi api = new FingerprintApi(client);
Integer limit = 10; // Integer | Limit the number of events returned.
String paginationKey = "paginationKey_example"; // String | Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085`
String visitorId = "visitorId_example"; // String | Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`.
String bot = "all"; // String | Filter events by the bot detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected.
String ipAddress = "ipAddress_example"; // String | Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32
Expand All @@ -427,7 +428,16 @@ public class FingerprintApiExample {
Boolean reverse = true; // Boolean | Sort events in reverse timestamp order.
Boolean suspect = true; // Boolean | Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response.
try {
SearchEventsResponse result = apiInstance.searchEvents(limit, visitorId, bot, ipAddress, linkedId, start, end, reverse, suspect);
SearchEventsResponse result = apiInstance.searchEvents(limit, new FingerprintApi.SearchEventsFilter()
.setPaginationKey(paginationKey)
.setVisitorId(visitorId)
.setBot(bot)
.setIpAddress(ipAddress)
.setLinkedId(linkedId)
.setStart(start)
.setEnd(end)
.setReverse(reverse)
.setSuspect(suspect));
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage());
Expand All @@ -443,6 +453,15 @@ public class FingerprintApiExample {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **limit** | **Integer**| Limit the number of events returned. | |
| **searchEventsFilter** | [**FingerprintApi.SearchEventsFilter**](#fingerprintapisearcheventsfilter) | | [optional] |

#### FingerprintApi.SearchEventsFilter

Filter object containing optional parameters for specifying search criteria. Supports a fluent interface for convenient method chaining.

| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **paginationKey** | **String**| Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/events/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085` | [optional] |
| **visitorId** | **String**| Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. | [optional] |
| **bot** | **String**| Filter events by the bot detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. | [optional] [enum: all, good, bad, none] |
| **ipAddress** | **String**| Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 | [optional] |
Expand Down
2 changes: 1 addition & 1 deletion docs/SearchEventsResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Contains a list of all identification events matching the specified search crite
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**events** | [**List<SearchEventsResponseEventsInner>**](SearchEventsResponseEventsInner.md) | | [optional] |
|**paginationKey** | **String** | | [optional] |
|**paginationKey** | **String** | Use this value in the `pagination_key` parameter to request the next page of search results. | [optional] |



Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void main(String... args) {

// Search events
try {
final Object events = api.searchEvents(2, null, "bad", null, null, null, null, null, null);
final Object events = api.searchEvents(2, new FingerprintApi.SearchEventsFilter().setBot("bad"));
System.out.println(events);
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage());
Expand Down
28 changes: 28 additions & 0 deletions res/fingerprint-server-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,29 @@ paths:
example: 10
description: |
Limit the number of events returned.
- name: pagination_key
in: query
schema:
type: string
description: >
Use `pagination_key` to get the next page of results.


When more results are available (e.g., you requested up to 200
results for your search using `limit`, but there are more than 200
events total matching your request), the `paginationKey` top-level
attribute is added to the response. The key corresponds to the
`timestamp` of the last returned event. In the following request,
use that value in the `pagination_key` parameter to get the next
page of results:


1. First request, returning most recent 200 events: `GET
api-base-url/events/search?limit=200`

2. Use `response.paginationKey` to get the next page of results:
`GET
api-base-url/events/search?limit=200&pagination_key=1740815825085`
- name: visitor_id
in: query
schema:
Expand Down Expand Up @@ -291,6 +314,7 @@ paths:
how long you should wait before making a follow-up request. The value is
non-negative decimal integer indicating the seconds to delay after the
response is received.
x-flattern-filter: true
parameters:
- name: visitor_id
in: path
Expand Down Expand Up @@ -601,6 +625,7 @@ paths:
Fake path to describe webhook format. More information about webhooks
can be found in the
[documentation](https://dev.fingerprint.com/docs/webhooks)
x-flattern-filter: true
requestBody:
content:
application/json:
Expand Down Expand Up @@ -2023,6 +2048,9 @@ components:
$ref: '#/components/schemas/Products'
paginationKey:
type: string
description: >-
Use this value in the `pagination_key` parameter to request the next
page of search results.
Visit:
type: object
additionalProperties: false
Expand Down
Loading
Loading