Skip to content

Commit 20f13f4

Browse files
Merge pull request #154 from fingerprintjs/feat/open-api-v2.3.0
OpenAPI schema sync
2 parents daa86a1 + 4c9b68e commit 20f13f4

File tree

11 files changed

+76
-35
lines changed

11 files changed

+76
-35
lines changed

.changeset/chubby-ducks-cheer.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-php-sdk': minor
3+
---
4+
5+
**events-search**: Add 'pagination_key' parameter

.schema-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.2.1
1+
v2.3.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ try {
125125
// Search for specific events
126126
try {
127127
// Search events for given visitor id marked as suspicious and "bad" bot
128-
list($model, $response) = $client->searchEvents(LIMIT, FPJS_VISITOR_ID, 'bad', null, null, null, null, null, true);
128+
list($model, $response) = $client->searchEvents(LIMIT, null, FPJS_VISITOR_ID, 'bad', null, null, null, null, null, true);
129129
echo "<pre>" . $response->getBody()->getContents() . "</pre>";
130130
} catch (Exception $e) {
131131
echo 'Exception when calling FingerprintApi->searchEvents: ', $e->getMessage(), PHP_EOL;

docs/Api/FingerprintApi.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ Array:
269269
[[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)
270270

271271
# **searchEvents**
272-
> [ \Fingerprint\ServerAPI\Model\SearchEventsResponse, \Psr\Http\Message\ResponseInterface ] searchEvents($limit, $visitor_id, $bot, $ip_address, $linked_id, $start, $end, $reverse, $suspect)
272+
> [ \Fingerprint\ServerAPI\Model\SearchEventsResponse, \Psr\Http\Message\ResponseInterface ] searchEvents($limit, $pagination_key, $visitor_id, $bot, $ip_address, $linked_id, $start, $end, $reverse, $suspect)
273273
274274
Get events via search
275275

@@ -296,6 +296,7 @@ $config
296296
);
297297

298298
$limit = 56; // int | Limit the number of events returned.
299+
$pagination_key = "pagination_key_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`
299300
$visitor_id = "visitor_id_example"; // string | Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`.
300301
$bot = "bot_example"; // 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.
301302
$ip_address = "ip_address_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
@@ -306,7 +307,7 @@ $reverse = true; // bool | Sort events in reverse timestamp order.
306307
$suspect = true; // bool | 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.
307308

308309
try {
309-
list($model, $httpResponse) = $client->searchEvents($limit, $visitor_id, $bot, $ip_address, $linked_id, $start, $end, $reverse, $suspect);
310+
list($model, $httpResponse) = $client->searchEvents($limit, $pagination_key, $visitor_id, $bot, $ip_address, $linked_id, $start, $end, $reverse, $suspect);
310311
echo "<pre>" . $httpResponse->getBody()->getContents() . "</pre>";
311312
} catch (Exception $e) {
312313
echo 'Exception when calling FingerprintApi->searchEvents: ', $e->getMessage(), PHP_EOL;
@@ -319,6 +320,7 @@ try {
319320
Name | Type | Description | Notes
320321
------------- | ------------- | ------------- | -------------
321322
**limit** | **int**| Limit the number of events returned. |
323+
**pagination_key** | **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]
322324
**visitor_id** | **string**| Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. | [optional]
323325
**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]
324326
**ip_address** | **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]

docs/Model/SearchEventsResponse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Contains a list of all identification events matching the specified search crite
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**events** | [**\Fingerprint\ServerAPI\Model\SearchEventsResponseEvents[]**](SearchEventsResponseEvents.md) | | [optional]
9-
**pagination_key** | **string** | | [optional]
9+
**pagination_key** | **string** | Use this value in the `pagination_key` parameter to request the next page of search results. | [optional]
1010

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

res/fingerprint-server-api.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,29 @@ paths:
168168
example: 10
169169
description: |
170170
Limit the number of events returned.
171+
- name: pagination_key
172+
in: query
173+
schema:
174+
type: string
175+
description: >
176+
Use `pagination_key` to get the next page of results.
177+
178+
179+
When more results are available (e.g., you requested up to 200
180+
results for your search using `limit`, but there are more than 200
181+
events total matching your request), the `paginationKey` top-level
182+
attribute is added to the response. The key corresponds to the
183+
`timestamp` of the last returned event. In the following request,
184+
use that value in the `pagination_key` parameter to get the next
185+
page of results:
186+
187+
188+
1. First request, returning most recent 200 events: `GET
189+
api-base-url/events/search?limit=200`
190+
191+
2. Use `response.paginationKey` to get the next page of results:
192+
`GET
193+
api-base-url/events/search?limit=200&pagination_key=1740815825085`
171194
- name: visitor_id
172195
in: query
173196
schema:
@@ -2023,6 +2046,9 @@ components:
20232046
$ref: '#/components/schemas/Products'
20242047
paginationKey:
20252048
type: string
2049+
description: >-
2050+
Use this value in the `pagination_key` parameter to request the next
2051+
page of search results.
20262052
Visit:
20272053
type: object
20282054
additionalProperties: false

run_checks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
$end = new DateTime();
9090

9191
/** @var SearchEventsResponse $result */
92-
list($result, $response) = $client->searchEvents(10, null, null, null, null, $start->getTimestamp() * 1000, $end->getTimestamp() * 1000);
92+
list($result, $response) = $client->searchEvents(10, null, null, null, null, null, $start->getTimestamp() * 1000, $end->getTimestamp() * 1000);
9393
if (!is_countable($result->getEvents()) || count($result->getEvents()) === 0) {
9494
throw new Exception('No events found');
9595
}

0 commit comments

Comments
 (0)