Skip to content
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/good-experts-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fingerprint-pro-server-api-python-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.
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": "rc",
"initialVersions": {
"fingerprint-pro-server-api-python-sdk": "8.2.1"
},
"changesets": []
}
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,36 @@ except ApiException as e:
print("Exception when calling FingerprintApi->get_event: %s\n" % e)
```

Search events with custom filters:
```python
import fingerprint_pro_server_api_sdk
from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException

configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY")
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)

limit = 20 # int | Limit the number of events returned.
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)
bot = 'good' # str | Filter events by the bot detection result, specifically: events where <'any'|'good'|'bad'|'none'> kind of bot was detected. (optional)
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)
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)
start = 1738687200000 # int | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional)
end = 1738773600000 # int | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional)
reverse = True # bool | Sort events in reverse timestamp order. (optional)
suspect = False # bool | Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). (optional)

try:
# Get events via search
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)
print(api_response)

except KnownApiException as e:
structured_error = e.structured_error
print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message))
except ApiException as e:
print("Exception when calling FingerprintApi->get_event: %s\n" % e)
```

Update event for requestId:
```python
import fingerprint_pro_server_api_sdk
Expand Down Expand Up @@ -256,6 +286,7 @@ Class | Method | HTTP request | Description
*FingerprintApi* | [**get_event**](docs/FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by request ID
*FingerprintApi* | [**get_related_visitors**](docs/FingerprintApi.md#get_related_visitors) | **GET** /related-visitors | Get Related Visitors
*FingerprintApi* | [**get_visits**](docs/FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID
*FingerprintApi* | [**search_events**](docs/FingerprintApi.md#search_events) | **GET** /events/search | Get events via search
*FingerprintApi* | [**update_event**](docs/FingerprintApi.md#update_event) | **PUT** /events/{request_id} | Update an event with a given request ID

## Documentation For Models
Expand Down Expand Up @@ -330,6 +361,8 @@ Class | Method | HTTP request | Description
- [RelatedVisitorsResponse](docs/RelatedVisitorsResponse.md)
- [RemoteControl](docs/RemoteControl.md)
- [RootApps](docs/RootApps.md)
- [SearchEventsResponse](docs/SearchEventsResponse.md)
- [SearchEventsResponseEvents](docs/SearchEventsResponseEvents.md)
- [SuspectScore](docs/SuspectScore.md)
- [Tag](docs/Tag.md)
- [Tampering](docs/Tampering.md)
Expand Down
67 changes: 67 additions & 0 deletions docs/FingerprintApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Method | HTTP request | Description
[**get_event**](FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by request ID
[**get_related_visitors**](FingerprintApi.md#get_related_visitors) | **GET** /related-visitors | Get Related Visitors
[**get_visits**](FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID
[**search_events**](FingerprintApi.md#search_events) | **GET** /events/search | Get events via search
[**update_event**](FingerprintApi.md#update_event) | **PUT** /events/{request_id} | Update an event with a given request ID

# **delete_visitor_data**
Expand Down Expand Up @@ -219,6 +220,72 @@ Name | Type | Description | Notes

[[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)

# **search_events**
> 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)

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
```python
import fingerprint_pro_server_api_sdk
from fingerprint_pro_server_api_sdk.rest import ApiException

# Configure API key authorization and region
configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY")
# configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY", region="eu")

# create an instance of the API class
api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration)

limit = 56 # int | Limit the number of events returned.
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)
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)
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)
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)
start = 789 # int | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional)
end = 789 # int | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional)
reverse = true # bool | Sort events in reverse timestamp order. (optional)
suspect = true # bool | Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). (optional)

try:
# Get events via search
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)
print(api_response)
except ApiException as e:
print("Exception when calling FingerprintApi->search_events: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**limit** | **int**| Limit the number of events returned. |
**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]
**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]
**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]
**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]
**start** | **int**| Filter events with a timestamp greater than the start time, in Unix time (milliseconds). | [optional]
**end** | **int**| Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). | [optional]
**reverse** | **bool**| Sort events in reverse timestamp order. | [optional]
**suspect** | **bool**| 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

[[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)

# **update_event**
> update_event(body, request_id)

Expand Down
12 changes: 12 additions & 0 deletions docs/SearchEventsResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SearchEventsResponse
Contains a list of all identification events matching the specified search criteria.


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**events** | [**list[SearchEventsResponseEvents]**](SearchEventsResponseEvents.md) | | [optional]
**pagination_key** | **str** | | [optional]

[[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 changes: 11 additions & 0 deletions docs/SearchEventsResponseEvents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SearchEventsResponseEvents
Device intelligence results for the identification event.


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

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

2 changes: 2 additions & 0 deletions fingerprint_pro_server_api_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
from fingerprint_pro_server_api_sdk.models.related_visitors_response import RelatedVisitorsResponse
from fingerprint_pro_server_api_sdk.models.remote_control import RemoteControl
from fingerprint_pro_server_api_sdk.models.root_apps import RootApps
from fingerprint_pro_server_api_sdk.models.search_events_response import SearchEventsResponse
from fingerprint_pro_server_api_sdk.models.search_events_response_events import SearchEventsResponseEvents
from fingerprint_pro_server_api_sdk.models.suspect_score import SuspectScore
from fingerprint_pro_server_api_sdk.models.tag import Tag
from fingerprint_pro_server_api_sdk.models.tampering import Tampering
Expand Down
Loading
Loading