Skip to content

Commit f8f1414

Browse files
authored
Merge pull request #102 from fingerprintjs/feat/open-api-v2.2.0
OpenAPI schema sync
2 parents 4758d78 + 2fe4e50 commit f8f1414

15 files changed

+746
-4
lines changed

.changeset/good-experts-watch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'fingerprint-pro-server-api-python-sdk': minor
3+
---
4+
5+
**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.

.changeset/pre.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mode": "pre",
3+
"tag": "rc",
4+
"initialVersions": {
5+
"fingerprint-pro-server-api-python-sdk": "8.2.1"
6+
},
7+
"changesets": []
8+
}

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,36 @@ except ApiException as e:
149149
print("Exception when calling FingerprintApi->get_event: %s\n" % e)
150150
```
151151

152+
Search events with custom filters:
153+
```python
154+
import fingerprint_pro_server_api_sdk
155+
from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException
156+
157+
configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY")
158+
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)
159+
160+
limit = 20 # int | Limit the number of events returned.
161+
visitor_id = 'VISITOR_ID' # str | Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional)
162+
bot = 'good' # str | Filter events by the bot detection result, specifically: events where <'any'|'good'|'bad'|'none'> kind of bot was detected. (optional)
163+
ip_address = '192.168.0.1/32' # str | 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)
164+
linked_id = 'linked_id_example' # str | 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)
165+
start = 1738687200000 # int | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional)
166+
end = 1738773600000 # int | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional)
167+
reverse = True # bool | Sort events in reverse timestamp order. (optional)
168+
suspect = False # bool | Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). (optional)
169+
170+
try:
171+
# Get events via search
172+
api_response = api_instance.search_events(limit, visitor_id=visitor_id, bot=bot, ip_address=ip_address, linked_id=linked_id, start=start, end=end, reverse=reverse, suspect=suspect)
173+
print(api_response)
174+
175+
except KnownApiException as e:
176+
structured_error = e.structured_error
177+
print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message))
178+
except ApiException as e:
179+
print("Exception when calling FingerprintApi->get_event: %s\n" % e)
180+
```
181+
152182
Update event for requestId:
153183
```python
154184
import fingerprint_pro_server_api_sdk
@@ -256,6 +286,7 @@ Class | Method | HTTP request | Description
256286
*FingerprintApi* | [**get_event**](docs/FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by request ID
257287
*FingerprintApi* | [**get_related_visitors**](docs/FingerprintApi.md#get_related_visitors) | **GET** /related-visitors | Get Related Visitors
258288
*FingerprintApi* | [**get_visits**](docs/FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID
289+
*FingerprintApi* | [**search_events**](docs/FingerprintApi.md#search_events) | **GET** /events/search | Get events via search
259290
*FingerprintApi* | [**update_event**](docs/FingerprintApi.md#update_event) | **PUT** /events/{request_id} | Update an event with a given request ID
260291

261292
## Documentation For Models
@@ -330,6 +361,8 @@ Class | Method | HTTP request | Description
330361
- [RelatedVisitorsResponse](docs/RelatedVisitorsResponse.md)
331362
- [RemoteControl](docs/RemoteControl.md)
332363
- [RootApps](docs/RootApps.md)
364+
- [SearchEventsResponse](docs/SearchEventsResponse.md)
365+
- [SearchEventsResponseEvents](docs/SearchEventsResponseEvents.md)
333366
- [SuspectScore](docs/SuspectScore.md)
334367
- [Tag](docs/Tag.md)
335368
- [Tampering](docs/Tampering.md)

docs/FingerprintApi.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Method | HTTP request | Description
88
[**get_event**](FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by request ID
99
[**get_related_visitors**](FingerprintApi.md#get_related_visitors) | **GET** /related-visitors | Get Related Visitors
1010
[**get_visits**](FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID
11+
[**search_events**](FingerprintApi.md#search_events) | **GET** /events/search | Get events via search
1112
[**update_event**](FingerprintApi.md#update_event) | **PUT** /events/{request_id} | Update an event with a given request ID
1213

1314
# **delete_visitor_data**
@@ -219,6 +220,72 @@ Name | Type | Description | Notes
219220

220221
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
221222

223+
# **search_events**
224+
> SearchEventsResponse search_events(limit, visitor_id=visitor_id, bot=bot, ip_address=ip_address, linked_id=linked_id, start=start, end=end, reverse=reverse, suspect=suspect)
225+
226+
Get events via search
227+
228+
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.
229+
230+
### Example
231+
```python
232+
import fingerprint_pro_server_api_sdk
233+
from fingerprint_pro_server_api_sdk.rest import ApiException
234+
235+
# Configure API key authorization and region
236+
configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY")
237+
# configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY", region="eu")
238+
239+
# create an instance of the API class
240+
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)
241+
242+
limit = 56 # int | Limit the number of events returned.
243+
visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional)
244+
bot = 'bot_example' # str | 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)
245+
ip_address = 'ip_address_example' # str | 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)
246+
linked_id = 'linked_id_example' # str | 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)
247+
start = 789 # int | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional)
248+
end = 789 # int | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional)
249+
reverse = true # bool | Sort events in reverse timestamp order. (optional)
250+
suspect = true # bool | Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). (optional)
251+
252+
try:
253+
# Get events via search
254+
api_response = api_instance.search_events(limit, visitor_id=visitor_id, bot=bot, ip_address=ip_address, linked_id=linked_id, start=start, end=end, reverse=reverse, suspect=suspect)
255+
print(api_response)
256+
except ApiException as e:
257+
print("Exception when calling FingerprintApi->search_events: %s\n" % e)
258+
```
259+
260+
### Parameters
261+
262+
Name | Type | Description | Notes
263+
------------- | ------------- | ------------- | -------------
264+
**limit** | **int**| Limit the number of events returned. |
265+
**visitor_id** | **str**| Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. | [optional]
266+
**bot** | **str**| 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]
267+
**ip_address** | **str**| 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]
268+
**linked_id** | **str**| 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]
269+
**start** | **int**| Filter events with a timestamp greater than the start time, in Unix time (milliseconds). | [optional]
270+
**end** | **int**| Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). | [optional]
271+
**reverse** | **bool**| Sort events in reverse timestamp order. | [optional]
272+
**suspect** | **bool**| Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). | [optional]
273+
274+
### Return type
275+
276+
[**SearchEventsResponse**](SearchEventsResponse.md)
277+
278+
### Authorization
279+
280+
[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery)
281+
282+
### HTTP request headers
283+
284+
- **Content-Type**: Not defined
285+
- **Accept**: application/json
286+
287+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
288+
222289
# **update_event**
223290
> update_event(body, request_id)
224291

docs/SearchEventsResponse.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SearchEventsResponse
2+
Contains a list of all identification events matching the specified search criteria.
3+
4+
5+
## Properties
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**events** | [**list[SearchEventsResponseEvents]**](SearchEventsResponseEvents.md) | | [optional]
9+
**pagination_key** | **str** | | [optional]
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+

docs/SearchEventsResponseEvents.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SearchEventsResponseEvents
2+
Device intelligence results for the identification event.
3+
4+
5+
## Properties
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**products** | [**Products**](Products.md) | |
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+

fingerprint_pro_server_api_sdk/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@
9090
from fingerprint_pro_server_api_sdk.models.related_visitors_response import RelatedVisitorsResponse
9191
from fingerprint_pro_server_api_sdk.models.remote_control import RemoteControl
9292
from fingerprint_pro_server_api_sdk.models.root_apps import RootApps
93+
from fingerprint_pro_server_api_sdk.models.search_events_response import SearchEventsResponse
94+
from fingerprint_pro_server_api_sdk.models.search_events_response_events import SearchEventsResponseEvents
9395
from fingerprint_pro_server_api_sdk.models.suspect_score import SuspectScore
9496
from fingerprint_pro_server_api_sdk.models.tag import Tag
9597
from fingerprint_pro_server_api_sdk.models.tampering import Tampering

0 commit comments

Comments
 (0)