Skip to content

Commit

Permalink
feat: update OpenAPI schema
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUnderScorer committed Feb 3, 2025
1 parent ece6020 commit a276c75
Show file tree
Hide file tree
Showing 12 changed files with 634 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-seas-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fingerprint-pro-server-api-java-sdk': minor
---

Add `relay` detection method to the VPN Detection Smart Signal
5 changes: 5 additions & 0 deletions .changeset/good-experts-watch.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 a new `events/search` API endpoint. Allow users to search for identification events matching one or more search criteria, for example, visitor ID, IP address, bot detection result, etc.
5 changes: 5 additions & 0 deletions .changeset/orange-poets-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fingerprint-pro-server-api-java-sdk': minor
---

**events**: Add a `suspect` field to the `identification` product schema
8 changes: 8 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mode": "pre",
"tag": "develop",
"initialVersions": {
"fingerprint-pro-server-api-java-sdk": "7.2.0"
},
"changesets": []
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ Class | Method | HTTP request | Description
*FingerprintApi* | [**getEvent**](docs/FingerprintApi.md#getEvent) | **GET** /events/{request_id} | Get event by request ID
*FingerprintApi* | [**getRelatedVisitors**](docs/FingerprintApi.md#getRelatedVisitors) | **GET** /related-visitors | Get Related Visitors
*FingerprintApi* | [**getVisits**](docs/FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID
*FingerprintApi* | [**searchEvents**](docs/FingerprintApi.md#searchEvents) | **GET** /events/search | Get events via search
*FingerprintApi* | [**updateEvent**](docs/FingerprintApi.md#updateEvent) | **PUT** /events/{request_id} | Update an event with a given request ID
*FingerprintApi* | [**webhookTrace**](docs/FingerprintApi.md#webhookTrace) | **TRACE** /webhook |

Expand Down Expand Up @@ -351,6 +352,8 @@ Class | Method | HTTP request | Description
- [RelatedVisitorsResponse](docs/RelatedVisitorsResponse.md)
- [RemoteControl](docs/RemoteControl.md)
- [RootApps](docs/RootApps.md)
- [SearchEventsResponse](docs/SearchEventsResponse.md)
- [SearchEventsResponseEventsInner](docs/SearchEventsResponseEventsInner.md)
- [SuspectScore](docs/SuspectScore.md)
- [Tampering](docs/Tampering.md)
- [Tor](docs/Tor.md)
Expand Down
97 changes: 97 additions & 0 deletions docs/FingerprintApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All URIs are relative to *https://api.fpjs.io*
| [**getEvent**](FingerprintApi.md#getEvent) | **GET** /events/{request_id} | Get event by request ID |
| [**getRelatedVisitors**](FingerprintApi.md#getRelatedVisitors) | **GET** /related-visitors | Get Related Visitors |
| [**getVisits**](FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID |
| [**searchEvents**](FingerprintApi.md#searchEvents) | **GET** /events/search | Get events via search |
| [**updateEvent**](FingerprintApi.md#updateEvent) | **PUT** /events/{request_id} | Update an event with a given request ID |
| [**webhookTrace**](FingerprintApi.md#webhookTrace) | **TRACE** /webhook | |

Expand Down Expand Up @@ -376,6 +377,102 @@ public class FingerprintApiExample {
| **429** | Too Many Requests. The request is throttled. | * Retry-After - Indicates how many seconds you should wait before attempting the next request. <br> |


## searchEvents

> SearchEventsResponse searchEvents(limit, visitorId, bot, ipAddress, linkedId, start, end, reverse, suspect)
Get events via search

Search for identification events, including Smart Signals, using multiple filtering criteria. If you don't provide `start` or `end` parameters, the default search range is the last 7 days.

Please note that events include mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. We recommend you **ignore** mobile signals for such requests.


### Example

```java
package main;

import com.fingerprint.api.FingerprintApi;
import com.fingerprint.model.EventsGetResponse;
import com.fingerprint.model.EventsUpdateRequest;
import com.fingerprint.model.VisitorsGetResponse;
import com.fingerprint.sdk.ApiClient;
import com.fingerprint.sdk.ApiException;
import com.fingerprint.sdk.Configuration;
import com.fingerprint.sdk.Region;

public class FingerprintApiExample {
// Fingerprint Pro Secret API Key
private static final String FPJS_API_SECRET = "Fingerprint Pro Secret API Key";
public static void main(String... args) {
// Create a new api client instance from Configuration with your Fingerprint Pro Server API Key and your Fingerprint Pro Server API Region.
/*
You can specify a region on getDefaultApiClient function's second parameter
If you leave the second parameter empty, then Region.GLOBAL will be used as a default region
Options for regions are:
Region.GLOBAL
Region.EUROPE
Region.ASIA
*/
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 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: - events where any kind of bot was detected. - events where a good bot was detected. - events where a bad bot was detected. - 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
String linkedId = "linkedId_example"; // String | Filter events by your custom identifier. You can use [linked IDs](https://dev.fingerprint.com/reference/get-function#linkedid) to associate identification requests with your own identifier, for example, session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier.
Long start = 56L; // Long | Filter events with a timestamp greater than the start time, in Unix time (milliseconds).
Long end = 56L; // Long | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds).
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).
try {
SearchEventsResponse result = apiInstance.searchEvents(limit, visitorId, bot, ipAddress, linkedId, start, end, reverse, suspect);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage());
}
}
}
```


### Parameters


| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **limit** | **Integer**| Limit the number of events returned. | |
| **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: - events where any kind of bot was detected. - events where a good bot was detected. - events where a bad bot was detected. - 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] |
| **linkedId** | **String**| Filter events by your custom identifier. You can use [linked IDs](https://dev.fingerprint.com/reference/get-function#linkedid) to associate identification requests with your own identifier, for example, session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. | [optional] |
| **start** | **Long**| Filter events with a timestamp greater than the start time, in Unix time (milliseconds). | [optional] |
| **end** | **Long**| Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). | [optional] |
| **reverse** | **Boolean**| Sort events in reverse timestamp order. | [optional] |
| **suspect** | **Boolean**| Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). | [optional] |

### Return type

[**SearchEventsResponse**](SearchEventsResponse.md)

### Authorization

[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Events matching the filter(s). | - |
| **400** | Bad request. One or more supplied search parameters are invalid, or a required parameter is missing. | - |
| **403** | Forbidden. Access to this API is denied. | - |


## updateEvent

> updateEvent(requestId, eventsUpdateRequest)
Expand Down
15 changes: 15 additions & 0 deletions docs/SearchEventsResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


# SearchEventsResponse

Contains a list of all identification events matching the specified search criteria.

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**events** | [**List&lt;SearchEventsResponseEventsInner&gt;**](SearchEventsResponseEventsInner.md) | | [optional] |
|**paginationKey** | **String** | | [optional] |



14 changes: 14 additions & 0 deletions docs/SearchEventsResponseEventsInner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@


# SearchEventsResponseEventsInner

Device intelligence results for the identification event.

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**products** | [**Products**](Products.md) | | |



144 changes: 144 additions & 0 deletions res/fingerprint-server-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,131 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/events/search:
get:
tags:
- Fingerprint
operationId: searchEvents
summary: Get events via search
description: >
Search for identification events, including Smart Signals, using
multiple filtering criteria. If you don't provide `start` or `end`
parameters, the default search range is the last 7 days.
Please note that events include mobile signals (e.g. `rootApps`) even if
the request originated from a non-mobile platform. We recommend you
**ignore** mobile signals for such requests.
parameters:
- name: limit
in: query
required: true
schema:
type: integer
format: int32
minimum: 1
example: 10
description: |
Limit the number of events returned.
- name: visitor_id
in: query
schema:
type: string
description: >
Unique [visitor
identifier](https://dev.fingerprint.com/reference/get-function#visitorid)
issued by Fingerprint Pro.
Filter for events matching this `visitor_id`.
- name: bot
in: query
schema:
type: string
enum:
- all
- good
- bad
- none
description: |
Filter events by the bot detection result, specifically:
- events where any kind of bot was detected.
- events where a good bot was detected.
- events where a bad bot was detected.
- events where no bot was detected.
- name: ip_address
in: query
schema:
type: string
description: >
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
- name: linked_id
in: query
schema:
type: string
description: >
Filter events by your custom identifier.
You can use [linked
IDs](https://dev.fingerprint.com/reference/get-function#linkedid) to
associate identification requests with your own identifier, for
example, session ID, purchase ID, or transaction ID. You can then
use this `linked_id` parameter to retrieve all events associated
with your custom identifier.
- name: start
in: query
schema:
type: integer
format: int64
description: >
Filter events with a timestamp greater than the start time, in Unix
time (milliseconds).
- name: end
in: query
schema:
type: integer
format: int64
description: >
Filter events with a timestamp smaller than the end time, in Unix
time (milliseconds).
- name: reverse
in: query
schema:
type: boolean
description: |
Sort events in reverse timestamp order.
- name: suspect
in: query
schema:
type: boolean
description: >
Filter events previously tagged as suspicious via the [Update
API](https://dev.fingerprint.com/reference/updateevent).
responses:
'200':
description: Events matching the filter(s).
content:
application/json:
schema:
$ref: '#/components/schemas/SearchEventsResponse'
'400':
description: >-
Bad request. One or more supplied search parameters are invalid, or
a required parameter is missing.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden. Access to this API is denied.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/visitors/{visitor_id}:
get:
tags:
Expand Down Expand Up @@ -1874,6 +1999,25 @@ components:
suspect:
type: boolean
description: Suspect flag indicating observed suspicious or fraudulent event
SearchEventsResponse:
type: object
description: >-
Contains a list of all identification events matching the specified
search criteria.
additionalProperties: false
properties:
events:
type: array
items:
type: object
description: Device intelligence results for the identification event.
required:
- products
properties:
products:
$ref: '#/components/schemas/Products'
paginationKey:
type: string
Visit:
type: object
additionalProperties: false
Expand Down
Loading

0 comments on commit a276c75

Please sign in to comment.