diff --git a/.changeset/shiny-ghosts-sin.md b/.changeset/shiny-ghosts-sin.md new file mode 100644 index 00000000..a21b5740 --- /dev/null +++ b/.changeset/shiny-ghosts-sin.md @@ -0,0 +1,5 @@ +--- +'fingerprint-pro-server-api-php-sdk': minor +--- + +**events-search**: Event search now supports two new filter parameters: `ip_blocklist`, `datacenter` diff --git a/.schema-version b/.schema-version index d80b4a81..7433fb30 100644 --- a/.schema-version +++ b/.schema-version @@ -1 +1 @@ -v2.5.0 \ No newline at end of file +v2.6.0 \ No newline at end of file diff --git a/docs/Api/FingerprintApi.md b/docs/Api/FingerprintApi.md index 4027ace1..dde8a36c 100644 --- a/docs/Api/FingerprintApi.md +++ b/docs/Api/FingerprintApi.md @@ -269,7 +269,7 @@ Array: [[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) # **searchEvents** -> [ \Fingerprint\ServerAPI\Model\SearchEventsResponse, \Psr\Http\Message\ResponseInterface ] searchEvents($limit, $pagination_key, $visitor_id, $bot, $ip_address, $linked_id, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score) +> [ \Fingerprint\ServerAPI\Model\SearchEventsResponse, \Psr\Http\Message\ResponseInterface ] searchEvents($limit, $pagination_key, $visitor_id, $bot, $ip_address, $linked_id, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $ip_blocklist, $datacenter) Get events via search @@ -319,9 +319,11 @@ $emulator = true; // bool | Filter events by Android Emulator Detection result. $root_apps = true; // bool | Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `products.rootApps.data.result` property set to `true` or `false` are returned. Events without a `products.rootApps` Smart Signal result are left out of the response. $vpn_confidence = "vpn_confidence_example"; // string | Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `products.vpn.data.confidence` property set to a valid value are returned. Events without a `products.vpn` Smart Signal result are left out of the response. $min_suspect_score = 3.4; // float | Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `products.suspectScore.data.result` property set to a value exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response. +$ip_blocklist = true; // bool | Filter events by IP Blocklist Detection result. > Note: When using this parameter, only events with the `products.ipBlocklist.data.result` property set to `true` or `false` are returned. Events without a `products.ipBlocklist` Smart Signal result are left out of the response. +$datacenter = true; // bool | Filter events by Datacenter Detection result. > Note: When using this parameter, only events with the `products.ipInfo.data.v4.datacenter.result` or `products.ipInfo.data.v6.datacenter.result` property set to `true` or `false` are returned. Events without a `products.ipInfo` Smart Signal result are left out of the response. try { - list($model, $httpResponse) = $client->searchEvents($limit, pagination_key: $pagination_key, visitor_id: $visitor_id, bot: $bot, ip_address: $ip_address, linked_id: $linked_id, start: $start, end: $end, reverse: $reverse, suspect: $suspect, vpn: $vpn, virtual_machine: $virtual_machine, tampering: $tampering, anti_detect_browser: $anti_detect_browser, incognito: $incognito, privacy_settings: $privacy_settings, jailbroken: $jailbroken, frida: $frida, factory_reset: $factory_reset, cloned_app: $cloned_app, emulator: $emulator, root_apps: $root_apps, vpn_confidence: $vpn_confidence, min_suspect_score: $min_suspect_score); + list($model, $httpResponse) = $client->searchEvents($limit, pagination_key: $pagination_key, visitor_id: $visitor_id, bot: $bot, ip_address: $ip_address, linked_id: $linked_id, start: $start, end: $end, reverse: $reverse, suspect: $suspect, vpn: $vpn, virtual_machine: $virtual_machine, tampering: $tampering, anti_detect_browser: $anti_detect_browser, incognito: $incognito, privacy_settings: $privacy_settings, jailbroken: $jailbroken, frida: $frida, factory_reset: $factory_reset, cloned_app: $cloned_app, emulator: $emulator, root_apps: $root_apps, vpn_confidence: $vpn_confidence, min_suspect_score: $min_suspect_score, ip_blocklist: $ip_blocklist, datacenter: $datacenter); echo "
" . $httpResponse->getBody()->getContents() . ""; } catch (Exception $e) { echo 'Exception when calling FingerprintApi->searchEvents: ', $e->getMessage(), PHP_EOL; @@ -357,6 +359,8 @@ Name | Type | Description | Notes **root_apps** | **bool**| Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `products.rootApps.data.result` property set to `true` or `false` are returned. Events without a `products.rootApps` Smart Signal result are left out of the response. | [optional] **vpn_confidence** | **string**| Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `products.vpn.data.confidence` property set to a valid value are returned. Events without a `products.vpn` Smart Signal result are left out of the response. | [optional] **min_suspect_score** | **float**| Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `products.suspectScore.data.result` property set to a value exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response. | [optional] + **ip_blocklist** | **bool**| Filter events by IP Blocklist Detection result. > Note: When using this parameter, only events with the `products.ipBlocklist.data.result` property set to `true` or `false` are returned. Events without a `products.ipBlocklist` Smart Signal result are left out of the response. | [optional] + **datacenter** | **bool**| Filter events by Datacenter Detection result. > Note: When using this parameter, only events with the `products.ipInfo.data.v4.datacenter.result` or `products.ipInfo.data.v6.datacenter.result` property set to `true` or `false` are returned. Events without a `products.ipInfo` Smart Signal result are left out of the response. | [optional] ### Return type diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 3122979f..ff281b24 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -414,7 +414,7 @@ paths: schema: type: string enum: - - high, + - high - medium - low description: > @@ -444,6 +444,29 @@ paths: exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response. + - name: ip_blocklist + in: query + schema: + type: boolean + description: > + Filter events by IP Blocklist Detection result. + + > Note: When using this parameter, only events with the + `products.ipBlocklist.data.result` property set to `true` or `false` + are returned. Events without a `products.ipBlocklist` Smart Signal + result are left out of the response. + - name: datacenter + in: query + schema: + type: boolean + description: > + Filter events by Datacenter Detection result. + + > Note: When using this parameter, only events with the + `products.ipInfo.data.v4.datacenter.result` or + `products.ipInfo.data.v6.datacenter.result` property set to `true` + or `false` are returned. Events without a `products.ipInfo` Smart + Signal result are left out of the response. responses: '200': description: Events matching the filter(s). diff --git a/src/Api/FingerprintApi.php b/src/Api/FingerprintApi.php index f506f053..d96bfe3e 100644 --- a/src/Api/FingerprintApi.php +++ b/src/Api/FingerprintApi.php @@ -847,6 +847,8 @@ function ($e) { * @param bool $root_apps Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `products.rootApps.data.result` property set to `true` or `false` are returned. Events without a `products.rootApps` Smart Signal result are left out of the response. (optional) * @param string $vpn_confidence Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `products.vpn.data.confidence` property set to a valid value are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) * @param float $min_suspect_score Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `products.suspectScore.data.result` property set to a value exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response. (optional) + * @param bool $ip_blocklist Filter events by IP Blocklist Detection result. > Note: When using this parameter, only events with the `products.ipBlocklist.data.result` property set to `true` or `false` are returned. Events without a `products.ipBlocklist` Smart Signal result are left out of the response. (optional) + * @param bool $datacenter Filter events by Datacenter Detection result. > Note: When using this parameter, only events with the `products.ipInfo.data.v4.datacenter.result` or `products.ipInfo.data.v6.datacenter.result` property set to `true` or `false` are returned. Events without a `products.ipInfo` Smart Signal result are left out of the response. (optional) * * @return array{ \Fingerprint\ServerAPI\Model\SearchEventsResponse|null, \Psr\Http\Message\ResponseInterface } * @@ -855,10 +857,10 @@ function ($e) { * @throws GuzzleException * @throws ApiException */ - public function searchEvents(int $limit, ?string $pagination_key = null, ?string $visitor_id = null, ?string $bot = null, ?string $ip_address = null, ?string $linked_id = null, ?int $start = null, ?int $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?string $vpn_confidence = null, ?float $min_suspect_score = null): array + public function searchEvents(int $limit, ?string $pagination_key = null, ?string $visitor_id = null, ?string $bot = null, ?string $ip_address = null, ?string $linked_id = null, ?int $start = null, ?int $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?string $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $ip_blocklist = null, ?bool $datacenter = null): array { $returnType = '\Fingerprint\ServerAPI\Model\SearchEventsResponse'; - $request = $this->searchEventsRequest($limit, $pagination_key, $visitor_id, $bot, $ip_address, $linked_id, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score); + $request = $this->searchEventsRequest($limit, $pagination_key, $visitor_id, $bot, $ip_address, $linked_id, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $ip_blocklist, $datacenter); try { $options = $this->createHttpClientOption(); @@ -961,16 +963,18 @@ public function searchEvents(int $limit, ?string $pagination_key = null, ?string * @param bool $root_apps Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `products.rootApps.data.result` property set to `true` or `false` are returned. Events without a `products.rootApps` Smart Signal result are left out of the response. (optional) * @param string $vpn_confidence Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `products.vpn.data.confidence` property set to a valid value are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) * @param float $min_suspect_score Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `products.suspectScore.data.result` property set to a value exceeding your threshold are returned. Events without a `products.suspectScore` Smart Signal result are left out of the response. (optional) + * @param bool $ip_blocklist Filter events by IP Blocklist Detection result. > Note: When using this parameter, only events with the `products.ipBlocklist.data.result` property set to `true` or `false` are returned. Events without a `products.ipBlocklist` Smart Signal result are left out of the response. (optional) + * @param bool $datacenter Filter events by Datacenter Detection result. > Note: When using this parameter, only events with the `products.ipInfo.data.v4.datacenter.result` or `products.ipInfo.data.v6.datacenter.result` property set to `true` or `false` are returned. Events without a `products.ipInfo` Smart Signal result are left out of the response. (optional) * * @throws \InvalidArgumentException * @throws SerializationException * @throws GuzzleException * @throws ApiException */ - public function searchEventsAsync(int $limit, ?string $pagination_key = null, ?string $visitor_id = null, ?string $bot = null, ?string $ip_address = null, ?string $linked_id = null, ?int $start = null, ?int $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?string $vpn_confidence = null, ?float $min_suspect_score = null): PromiseInterface + public function searchEventsAsync(int $limit, ?string $pagination_key = null, ?string $visitor_id = null, ?string $bot = null, ?string $ip_address = null, ?string $linked_id = null, ?int $start = null, ?int $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?string $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $ip_blocklist = null, ?bool $datacenter = null): PromiseInterface { $returnType = '\Fingerprint\ServerAPI\Model\SearchEventsResponse'; - $request = $this->searchEventsRequest($limit, $pagination_key, $visitor_id, $bot, $ip_address, $linked_id, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score); + $request = $this->searchEventsRequest($limit, $pagination_key, $visitor_id, $bot, $ip_address, $linked_id, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $ip_blocklist, $datacenter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1511,7 +1515,7 @@ protected function getVisitsRequest(string $visitor_id, ?string $request_id = nu * @throws GuzzleException * @throws ApiException */ - protected function searchEventsRequest(int $limit, ?string $pagination_key = null, ?string $visitor_id = null, ?string $bot = null, ?string $ip_address = null, ?string $linked_id = null, ?int $start = null, ?int $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?string $vpn_confidence = null, ?float $min_suspect_score = null): Request + protected function searchEventsRequest(int $limit, ?string $pagination_key = null, ?string $visitor_id = null, ?string $bot = null, ?string $ip_address = null, ?string $linked_id = null, ?int $start = null, ?int $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?string $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $ip_blocklist = null, ?bool $datacenter = null): Request { // verify the required parameter 'limit' is set if (null === $limit || (is_array($limit) && 0 === count($limit))) { @@ -1622,6 +1626,14 @@ protected function searchEventsRequest(int $limit, ?string $pagination_key = nul if (null !== $min_suspect_score) { $queryParams['min_suspect_score'] = ObjectSerializer::toQueryValue($min_suspect_score, 'float'); } + // query params + if (null !== $ip_blocklist) { + $queryParams['ip_blocklist'] = ObjectSerializer::toQueryValue($ip_blocklist, null); + } + // query params + if (null !== $datacenter) { + $queryParams['datacenter'] = ObjectSerializer::toQueryValue($datacenter, null); + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('Auth-API-Key'); diff --git a/test/FingerprintApiTest.php b/test/FingerprintApiTest.php index 232203d2..da7d1227 100644 --- a/test/FingerprintApiTest.php +++ b/test/FingerprintApiTest.php @@ -842,6 +842,8 @@ public function testSearchEventsWithAllParams() 'root_apps' => 'true', 'vpn_confidence' => 'medium', 'min_suspect_score' => '0.5', + 'ip_blocklist' => 'true', + 'datacenter' => 'true', ]; $extraKeys = ['ii', 'visitor_id']; @@ -880,6 +882,8 @@ public function testSearchEventsWithAllParams() root_apps: true, vpn_confidence: 'medium', min_suspect_score: 0.5, + ip_blocklist: true, + datacenter: true, ); $this->assertCount(1, $events->getEvents());