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 all 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
12 changes: 7 additions & 5 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.SearchEventsOptionalParams().setVisitorId(FPJS_VISITOR_ID));
// Next page
// SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().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.SearchEventsOptionalParams().setBot("bad"));
// 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());
// SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setIpAddress("192.168.0.1/32"));
System.out.println(response.getEvents().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
35 changes: 27 additions & 8 deletions docs/FingerprintApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class FingerprintApiExample {
FingerprintApi api = new FingerprintApi(client);
String visitorId = "visitorId_example"; // String | The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete.
try {
apiInstance.deleteVisitorData(visitorId);
api.deleteVisitorData(visitorId);
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.deleteVisitorData:" + e.getMessage());
}
Expand Down Expand Up @@ -159,7 +159,7 @@ public class FingerprintApiExample {
FingerprintApi api = new FingerprintApi(client);
String requestId = "requestId_example"; // String | The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request.
try {
EventsGetResponse result = apiInstance.getEvent(requestId);
EventsGetResponse result = api.getEvent(requestId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage());
Expand Down Expand Up @@ -243,7 +243,7 @@ public class FingerprintApiExample {
FingerprintApi api = new FingerprintApi(client);
String visitorId = "visitorId_example"; // String | The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device.
try {
RelatedVisitorsResponse result = apiInstance.getRelatedVisitors(visitorId);
RelatedVisitorsResponse result = api.getRelatedVisitors(visitorId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.getRelatedVisitors:" + e.getMessage());
Expand Down Expand Up @@ -333,7 +333,7 @@ public class FingerprintApiExample {
String paginationKey = "paginationKey_example"; // String | Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned.
Long before = 56L; // Long | ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results.
try {
VisitorsGetResponse result = apiInstance.getVisits(visitorId, requestId, linkedId, limit, paginationKey, before);
VisitorsGetResponse result = api.getVisits(visitorId, requestId, linkedId, limit, paginationKey, before);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.getVisits:" + e.getMessage());
Expand Down Expand Up @@ -379,7 +379,7 @@ public class FingerprintApiExample {

## searchEvents

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

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 = api.searchEvents(limit, new FingerprintApi.SearchEventsOptionalParams()
.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. | |
| **searchEventsOptionalParams** | [**FingerprintApi.SearchEventsOptionalParams**](#fingerprintapisearcheventsoptionalparams) | | [optional] |

#### FingerprintApi.SearchEventsOptionalParams

Object containing optional parameters for API method. 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 Expand Up @@ -518,7 +537,7 @@ public class FingerprintApiExample {
String requestId = "requestId_example"; // String | The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid).
EventsUpdateRequest eventsUpdateRequest = new EventsUpdateRequest(); // EventsUpdateRequest |
try {
apiInstance.updateEvent(requestId, eventsUpdateRequest);
api.updateEvent(requestId, eventsUpdateRequest);
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.updateEvent:" + e.getMessage());
}
Expand Down Expand Up @@ -597,7 +616,7 @@ public class FingerprintApiExample {
FingerprintApi api = new FingerprintApi(client);
Webhook webhook = new Webhook(); // Webhook |
try {
apiInstance.webhookTrace(webhook);
api.webhookTrace(webhook);
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.webhookTrace:" + e.getMessage());
}
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
@@ -1,7 +1,10 @@
package com.fingerprint.example;

import com.fingerprint.api.FingerprintApi;
import com.fingerprint.model.EventsGetResponse;
import com.fingerprint.model.EventsUpdateRequest;
import com.fingerprint.model.SearchEventsResponse;
import com.fingerprint.model.VisitorsGetResponse;
import com.fingerprint.sdk.ApiClient;
import com.fingerprint.sdk.ApiException;
import com.fingerprint.sdk.Configuration;
Expand All @@ -26,7 +29,7 @@ public static void main(String... args) {

// Get identification event
try {
final Object event = api.getEvent(FPJS_REQUEST_ID);
final EventsGetResponse event = api.getEvent(FPJS_REQUEST_ID);
System.out.println(event);
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage());
Expand All @@ -35,7 +38,7 @@ public static void main(String... args) {

// Get visitor history
try {
final Object visits = api.getVisits(FPJS_VISITOR_ID, null, null, null, null, null);
final VisitorsGetResponse visits = api.getVisits(FPJS_VISITOR_ID, null, null, null, null, null);
System.out.println(visits);
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage());
Expand All @@ -44,8 +47,8 @@ public static void main(String... args) {

// Search events
try {
final Object events = api.searchEvents(2, null, "bad", null, null, null, null, null, null);
System.out.println(events);
final SearchEventsResponse events = api.searchEvents(2, new FingerprintApi.SearchEventsOptionalParams().setBot("bad"));
System.out.println(events.getEvents());
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage());
System.exit(1);
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-flatten-optional-params: 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-flatten-optional-params: 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