From 9ec63ea694ecb71ce002e9243513947e131bc27c Mon Sep 17 00:00:00 2001 From: erayaydin Date: Wed, 16 Apr 2025 10:02:07 +0000 Subject: [PATCH 1/3] feat: sync OpenAPI schema to v2.5.0 --- .changeset/fuzzy-pumas-end.md | 5 + .changeset/pre.json | 8 + .changeset/shaky-goats-beam.md | 5 + .changeset/sharp-chicken-yawn.md | 5 + .changeset/thick-clouds-ring.md | 5 + .schema-version | 2 +- docs/Api/FingerprintApi.md | 38 ++++- docs/Model/Tampering.md | 6 +- docs/Model/Webhook.md | 1 + docs/Model/WebhookTampering.md | 6 +- res/fingerprint-server-api.yaml | 248 +++++++++++++++++++++++++++---- src/Api/FingerprintApi.php | 134 +++++++++++++---- src/Model/Tampering.php | 6 +- src/Model/Webhook.php | 28 ++++ src/Model/WebhookTampering.php | 6 +- 15 files changed, 430 insertions(+), 73 deletions(-) create mode 100644 .changeset/fuzzy-pumas-end.md create mode 100644 .changeset/pre.json create mode 100644 .changeset/shaky-goats-beam.md create mode 100644 .changeset/sharp-chicken-yawn.md create mode 100644 .changeset/thick-clouds-ring.md diff --git a/.changeset/fuzzy-pumas-end.md b/.changeset/fuzzy-pumas-end.md new file mode 100644 index 00000000..53b21b42 --- /dev/null +++ b/.changeset/fuzzy-pumas-end.md @@ -0,0 +1,5 @@ +--- +'fingerprint-pro-server-api-php-sdk': minor +--- + +**events-search**: Event search now supports a new set of filter parameters: `vpn`, `virtual_machine`, `tampering`, `anti_detect_browser`, `incognito`, `privacy_settings`, `jailbroken`, `frida`, `factory_reset`, `cloned_app`, `emulator`, `root_apps`, `vpn_confidence`, `min_suspect_score`. diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 00000000..37c4b393 --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,8 @@ +{ + "mode": "pre", + "tag": "develop", + "initialVersions": { + "fingerprint-pro-server-api-php-sdk": "6.4.0" + }, + "changesets": [] +} diff --git a/.changeset/shaky-goats-beam.md b/.changeset/shaky-goats-beam.md new file mode 100644 index 00000000..1e97eb86 --- /dev/null +++ b/.changeset/shaky-goats-beam.md @@ -0,0 +1,5 @@ +--- +'fingerprint-pro-server-api-php-sdk': patch +--- + +**webhook**: Apply x-flatten-optional-params: true in correct place in the webhook.yaml \ No newline at end of file diff --git a/.changeset/sharp-chicken-yawn.md b/.changeset/sharp-chicken-yawn.md new file mode 100644 index 00000000..41f2335b --- /dev/null +++ b/.changeset/sharp-chicken-yawn.md @@ -0,0 +1,5 @@ +--- +'fingerprint-pro-server-api-php-sdk': patch +--- + +**events**: Update Tampering descriptions to reflect Android support. \ No newline at end of file diff --git a/.changeset/thick-clouds-ring.md b/.changeset/thick-clouds-ring.md new file mode 100644 index 00000000..0cb66c42 --- /dev/null +++ b/.changeset/thick-clouds-ring.md @@ -0,0 +1,5 @@ +--- +"fingerprint-pro-server-api-php-sdk": patch +--- + +**webhook**: Add `environmentId` property diff --git a/.schema-version b/.schema-version index fa49670c..d80b4a81 100644 --- a/.schema-version +++ b/.schema-version @@ -1 +1 @@ -v2.4.0 \ No newline at end of file +v2.5.0 \ No newline at end of file diff --git a/docs/Api/FingerprintApi.md b/docs/Api/FingerprintApi.md index 364f1bb9..4027ace1 100644 --- a/docs/Api/FingerprintApi.md +++ b/docs/Api/FingerprintApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description Delete data by visitor ID -Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Application](https://dev.fingerprint.com/docs/glossary#fingerprint-application). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. +Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. ### Example ```php @@ -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) +> [ \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) Get events via search @@ -298,16 +298,30 @@ $config $limit = 56; // int | Limit the number of events returned. $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` $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`. -$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. +$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. > Note: When using this parameter, only events with the `products.botd.data.bot.result` property set to a valid value are returned. Events without a `products.botd` Smart Signal result are left out of the response. $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 $linked_id = "linked_id_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. $start = 789; // int | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). $end = 789; // int | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). $reverse = true; // bool | Sort events in reverse timestamp order. $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. +$vpn = true; // bool | Filter events by VPN Detection result. > Note: When using this parameter, only events with the `products.vpn.data.result` property set to `true` or `false` are returned. Events without a `products.vpn` Smart Signal result are left out of the response. +$virtual_machine = true; // bool | Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `products.virtualMachine.data.result` property set to `true` or `false` are returned. Events without a `products.virtualMachine` Smart Signal result are left out of the response. +$tampering = true; // bool | Filter events by Tampering Detection result. > Note: When using this parameter, only events with the `products.tampering.data.result` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. +$anti_detect_browser = true; // bool | Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `products.tampering.data.antiDetectBrowser` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. +$incognito = true; // bool | Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `products.incognito.data.result` property set to `true` or `false` are returned. Events without a `products.incognito` Smart Signal result are left out of the response. +$privacy_settings = true; // bool | Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `products.privacySettings.data.result` property set to `true` or `false` are returned. Events without a `products.privacySettings` Smart Signal result are left out of the response. +$jailbroken = true; // bool | Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `products.jailbroken.data.result` property set to `true` or `false` are returned. Events without a `products.jailbroken` Smart Signal result are left out of the response. +$frida = true; // bool | Filter events by Frida Detection result. > Note: When using this parameter, only events with the `products.frida.data.result` property set to `true` or `false` are returned. Events without a `products.frida` Smart Signal result are left out of the response. +$factory_reset = true; // bool | Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with the `products.factoryReset.data.result` property set to `true` or `false` are returned. Events without a `products.factoryReset` Smart Signal result are left out of the response. +$cloned_app = true; // bool | Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `products.clonedApp.data.result` property set to `true` or `false` are returned. Events without a `products.clonedApp` Smart Signal result are left out of the response. +$emulator = true; // bool | Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `products.emulator.data.result` property set to `true` or `false` are returned. Events without a `products.emulator` Smart Signal result are left out of the response. +$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. 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); + 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); echo "
" . $httpResponse->getBody()->getContents() . "
"; } catch (Exception $e) { echo 'Exception when calling FingerprintApi->searchEvents: ', $e->getMessage(), PHP_EOL; @@ -322,13 +336,27 @@ Name | Type | Description | Notes **limit** | **int**| Limit the number of events returned. | **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] **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] - **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] + **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. > Note: When using this parameter, only events with the `products.botd.data.bot.result` property set to a valid value are returned. Events without a `products.botd` Smart Signal result are left out of the response. | [optional] **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] **linked_id** | **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** | **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). > 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. | [optional] + **vpn** | **bool**| Filter events by VPN Detection result. > Note: When using this parameter, only events with the `products.vpn.data.result` property set to `true` or `false` are returned. Events without a `products.vpn` Smart Signal result are left out of the response. | [optional] + **virtual_machine** | **bool**| Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `products.virtualMachine.data.result` property set to `true` or `false` are returned. Events without a `products.virtualMachine` Smart Signal result are left out of the response. | [optional] + **tampering** | **bool**| Filter events by Tampering Detection result. > Note: When using this parameter, only events with the `products.tampering.data.result` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. | [optional] + **anti_detect_browser** | **bool**| Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `products.tampering.data.antiDetectBrowser` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. | [optional] + **incognito** | **bool**| Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `products.incognito.data.result` property set to `true` or `false` are returned. Events without a `products.incognito` Smart Signal result are left out of the response. | [optional] + **privacy_settings** | **bool**| Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `products.privacySettings.data.result` property set to `true` or `false` are returned. Events without a `products.privacySettings` Smart Signal result are left out of the response. | [optional] + **jailbroken** | **bool**| Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `products.jailbroken.data.result` property set to `true` or `false` are returned. Events without a `products.jailbroken` Smart Signal result are left out of the response. | [optional] + **frida** | **bool**| Filter events by Frida Detection result. > Note: When using this parameter, only events with the `products.frida.data.result` property set to `true` or `false` are returned. Events without a `products.frida` Smart Signal result are left out of the response. | [optional] + **factory_reset** | **bool**| Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with the `products.factoryReset.data.result` property set to `true` or `false` are returned. Events without a `products.factoryReset` Smart Signal result are left out of the response. | [optional] + **cloned_app** | **bool**| Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `products.clonedApp.data.result` property set to `true` or `false` are returned. Events without a `products.clonedApp` Smart Signal result are left out of the response. | [optional] + **emulator** | **bool**| Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `products.emulator.data.result` property set to `true` or `false` are returned. Events without a `products.emulator` Smart Signal result are left out of the response. | [optional] + **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] ### Return type diff --git a/docs/Model/Tampering.md b/docs/Model/Tampering.md index 662c2556..c6de6764 100644 --- a/docs/Model/Tampering.md +++ b/docs/Model/Tampering.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**result** | **bool** | Flag indicating browser tampering was detected. This happens when either of these conditions is true: * There are inconsistencies in the browser configuration that cross our internal tampering thresholds (indicated by `anomalyScore`). * The browser signature resembles one of \"anti-detect\" browsers specifically designed to evade identification and fingerprinting, for example, Incognition (indicated by `antiDetectBrowser`). | -**anomaly_score** | **double** | Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate that there was a tampering attempt. * Values below `0.5` indicate genuine browsers. | -**anti_detect_browser** | **bool** | Is `true` if the identified browser resembles one of \"anti-detect\" browsers, for example, Incognition. Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. | +**result** | **bool** | Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. | +**anomaly_score** | **double** | A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. | +**anti_detect_browser** | **bool** | Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Webhook.md b/docs/Model/Webhook.md index ad9532a6..165f72c6 100644 --- a/docs/Model/Webhook.md +++ b/docs/Model/Webhook.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes **request_id** | **string** | Unique identifier of the user's request. | **url** | **string** | Page URL from which the request was sent. | **ip** | **string** | IP address of the requesting browser or bot. | +**environment_id** | **string** | Environment ID of the event. | [optional] **tag** | array | | [optional] **time** | [**\DateTime**](\DateTime.md) | Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. | **timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | diff --git a/docs/Model/WebhookTampering.md b/docs/Model/WebhookTampering.md index 8e5a77c2..2c8fe0b2 100644 --- a/docs/Model/WebhookTampering.md +++ b/docs/Model/WebhookTampering.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**result** | **bool** | Flag indicating browser tampering was detected. This happens when either of these conditions is true: * There are inconsistencies in the browser configuration that cross our internal tampering thresholds (indicated by `anomalyScore`). * The browser signature resembles one of \"anti-detect\" browsers specifically designed to evade identification and fingerprinting, for example, Incognition (indicated by `antiDetectBrowser`). | [optional] -**anomaly_score** | **double** | Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate that there was a tampering attempt * Values below `0.5` indicate genuine browsers. | [optional] -**anti_detect_browser** | **bool** | Is `true` if the identified browser resembles one of \"anti-detect\" browsers, for example, Incognition. Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. | [optional] +**result** | **bool** | Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. | [optional] +**anomaly_score** | **double** | A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. | [optional] +**anti_detect_browser** | **bool** | Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. | [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) diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 301dd653..3122979f 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -210,12 +210,16 @@ paths: - good - bad - none - description: | - Filter events by the bot detection result, specifically: + description: > + 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. + > Note: When using this parameter, only events with the + `products.botd.data.bot.result` property set to a valid value are + returned. Events without a `products.botd` Smart Signal result are + left out of the response. - name: ip_address in: query schema: @@ -273,6 +277,173 @@ paths: > 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. + - name: vpn + in: query + schema: + type: boolean + description: > + Filter events by VPN Detection result. + + > Note: When using this parameter, only events with the + `products.vpn.data.result` property set to `true` or `false` are + returned. Events without a `products.vpn` Smart Signal result are + left out of the response. + - name: virtual_machine + in: query + schema: + type: boolean + description: > + Filter events by Virtual Machine Detection result. + + > Note: When using this parameter, only events with the + `products.virtualMachine.data.result` property set to `true` or + `false` are returned. Events without a `products.virtualMachine` + Smart Signal result are left out of the response. + - name: tampering + in: query + schema: + type: boolean + description: > + Filter events by Tampering Detection result. + + > Note: When using this parameter, only events with the + `products.tampering.data.result` property set to `true` or `false` + are returned. Events without a `products.tampering` Smart Signal + result are left out of the response. + - name: anti_detect_browser + in: query + schema: + type: boolean + description: > + Filter events by Anti-detect Browser Detection result. + + > Note: When using this parameter, only events with the + `products.tampering.data.antiDetectBrowser` property set to `true` + or `false` are returned. Events without a `products.tampering` Smart + Signal result are left out of the response. + - name: incognito + in: query + schema: + type: boolean + description: > + Filter events by Browser Incognito Detection result. + + > Note: When using this parameter, only events with the + `products.incognito.data.result` property set to `true` or `false` + are returned. Events without a `products.incognito` Smart Signal + result are left out of the response. + - name: privacy_settings + in: query + schema: + type: boolean + description: > + Filter events by Privacy Settings Detection result. + + > Note: When using this parameter, only events with the + `products.privacySettings.data.result` property set to `true` or + `false` are returned. Events without a `products.privacySettings` + Smart Signal result are left out of the response. + - name: jailbroken + in: query + schema: + type: boolean + description: > + Filter events by Jailbroken Device Detection result. + + > Note: When using this parameter, only events with the + `products.jailbroken.data.result` property set to `true` or `false` + are returned. Events without a `products.jailbroken` Smart Signal + result are left out of the response. + - name: frida + in: query + schema: + type: boolean + description: > + Filter events by Frida Detection result. + + > Note: When using this parameter, only events with the + `products.frida.data.result` property set to `true` or `false` are + returned. Events without a `products.frida` Smart Signal result are + left out of the response. + - name: factory_reset + in: query + schema: + type: boolean + description: > + Filter events by Factory Reset Detection result. + + > Note: When using this parameter, only events with the + `products.factoryReset.data.result` property set to `true` or + `false` are returned. Events without a `products.factoryReset` Smart + Signal result are left out of the response. + - name: cloned_app + in: query + schema: + type: boolean + description: > + Filter events by Cloned App Detection result. + + > Note: When using this parameter, only events with the + `products.clonedApp.data.result` property set to `true` or `false` + are returned. Events without a `products.clonedApp` Smart Signal + result are left out of the response. + - name: emulator + in: query + schema: + type: boolean + description: > + Filter events by Android Emulator Detection result. + + > Note: When using this parameter, only events with the + `products.emulator.data.result` property set to `true` or `false` + are returned. Events without a `products.emulator` Smart Signal + result are left out of the response. + - name: root_apps + in: query + schema: + type: boolean + description: > + 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. + - name: vpn_confidence + in: query + schema: + type: string + enum: + - high, + - medium + - low + description: > + 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. + - name: min_suspect_score + in: query + schema: + type: number + format: float + description: > + 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. responses: '200': description: Events matching the filter(s). @@ -474,7 +645,7 @@ paths: - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint - Application](https://dev.fingerprint.com/docs/glossary#fingerprint-application). + Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) @@ -630,6 +801,7 @@ paths: Fake path to describe webhook format. More information about webhooks can be found in the [documentation](https://dev.fingerprint.com/docs/webhooks) + x-flatten-optional-params: true requestBody: content: application/json: @@ -646,7 +818,6 @@ paths: You can use HTTP basic authentication and set up credentials in your [Fingerprint account](https://dashboard.fingerprint.com/login) - x-flatten-optional-params: true requestBody: content: application/json: @@ -1579,26 +1750,33 @@ components: result: type: boolean description: > - Flag indicating browser tampering was detected. This happens when - either of these conditions is true: - * There are inconsistencies in the browser configuration that cross our internal tampering thresholds (indicated by `anomalyScore`). - * The browser signature resembles one of "anti-detect" browsers specifically designed to evade identification and fingerprinting, for example, Incognition (indicated by `antiDetectBrowser`). + Indicates if an identification request from a browser or an Android + SDK has been tampered with. Not supported in the iOS SDK, is always + `false` for iOS requests. + * `true` - If the request meets either of the following conditions: + * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). + * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). + * `false` - If the request is considered genuine or was generated by the iOS SDK. anomalyScore: type: number format: double minimum: 0 maximum: 1 - description: | - Confidence score (`0.0 - 1.0`) for tampering detection: - * Values above `0.5` indicate that there was a tampering attempt. - * Values below `0.5` indicate genuine browsers. + description: > + A score that indicates the extent of anomalous data in the request. + This field applies to requests originating from **both** browsers + and Android SDKs. + * Values above `0.5` indicate that the request has been tampered with. + * Values below `0.5` indicate that the request is genuine. antiDetectBrowser: type: boolean - description: >- - Is `true` if the identified browser resembles one of "anti-detect" - browsers, for example, Incognition. Anti-detect browsers try to - evade identification by masking or manipulating their fingerprint to - imitate legitimate browser configurations. + description: > + Anti-detect browsers try to evade identification by masking or + manipulating their fingerprint to imitate legitimate browser + configurations. This field does not apply to requests originating + from mobile SDKs. + * `true` - The browser resembles a known anti-detect browser, for example, Incognition. + * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. ProductTampering: type: object additionalProperties: false @@ -2293,26 +2471,33 @@ components: result: type: boolean description: > - Flag indicating browser tampering was detected. This happens when - either of these conditions is true: - * There are inconsistencies in the browser configuration that cross our internal tampering thresholds (indicated by `anomalyScore`). - * The browser signature resembles one of "anti-detect" browsers specifically designed to evade identification and fingerprinting, for example, Incognition (indicated by `antiDetectBrowser`). + Indicates if an identification request from a browser or an Android + SDK has been tampered with. Not supported in the iOS SDK, is always + `false` for iOS requests. + * `true` - If the request meets either of the following conditions: + * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). + * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). + * `false` - If the request is considered genuine or was generated by the iOS SDK. anomalyScore: type: number format: double minimum: 0 maximum: 1 - description: | - Confidence score (`0.0 - 1.0`) for tampering detection: - * Values above `0.5` indicate that there was a tampering attempt - * Values below `0.5` indicate genuine browsers. + description: > + A score that indicates the extent of anomalous data in the request. + This field applies to requests originating from **both** browsers + and Android SDKs. + * Values above `0.5` indicate that the request has been tampered with. + * Values below `0.5` indicate that the request is genuine. antiDetectBrowser: type: boolean - description: >- - Is `true` if the identified browser resembles one of "anti-detect" - browsers, for example, Incognition. Anti-detect browsers try to - evade identification by masking or manipulating their fingerprint to - imitate legitimate browser configurations. + description: > + Anti-detect browsers try to evade identification by masking or + manipulating their fingerprint to imitate legitimate browser + configurations. This field does not apply to requests originating + from mobile SDKs. + * `true` - The browser resembles a known anti-detect browser, for example, Incognition. + * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. WebhookClonedApp: type: object additionalProperties: false @@ -2544,6 +2729,9 @@ components: ip: type: string description: IP address of the requesting browser or bot. + environmentId: + type: string + description: Environment ID of the event. tag: $ref: '#/components/schemas/Tag' time: diff --git a/src/Api/FingerprintApi.php b/src/Api/FingerprintApi.php index cfce22d8..f506f053 100644 --- a/src/Api/FingerprintApi.php +++ b/src/Api/FingerprintApi.php @@ -823,16 +823,30 @@ function ($e) { * * Get events via search * - * @param int $limit Limit the number of events returned. (required) - * @param string $pagination_key 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) - * @param string $visitor_id Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional) - * @param string $bot 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) - * @param string $ip_address 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) - * @param string $linked_id 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) - * @param int $start Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) - * @param int $end Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) - * @param bool $reverse Sort events in reverse timestamp order. (optional) - * @param bool $suspect 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. (optional) + * @param int $limit Limit the number of events returned. (required) + * @param string $pagination_key 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) + * @param string $visitor_id Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional) + * @param string $bot 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. > Note: When using this parameter, only events with the `products.botd.data.bot.result` property set to a valid value are returned. Events without a `products.botd` Smart Signal result are left out of the response. (optional) + * @param string $ip_address 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) + * @param string $linked_id 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) + * @param int $start Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) + * @param int $end Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) + * @param bool $reverse Sort events in reverse timestamp order. (optional) + * @param bool $suspect 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. (optional) + * @param bool $vpn Filter events by VPN Detection result. > Note: When using this parameter, only events with the `products.vpn.data.result` property set to `true` or `false` are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) + * @param bool $virtual_machine Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `products.virtualMachine.data.result` property set to `true` or `false` are returned. Events without a `products.virtualMachine` Smart Signal result are left out of the response. (optional) + * @param bool $tampering Filter events by Tampering Detection result. > Note: When using this parameter, only events with the `products.tampering.data.result` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) + * @param bool $anti_detect_browser Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `products.tampering.data.antiDetectBrowser` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) + * @param bool $incognito Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `products.incognito.data.result` property set to `true` or `false` are returned. Events without a `products.incognito` Smart Signal result are left out of the response. (optional) + * @param bool $privacy_settings Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `products.privacySettings.data.result` property set to `true` or `false` are returned. Events without a `products.privacySettings` Smart Signal result are left out of the response. (optional) + * @param bool $jailbroken Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `products.jailbroken.data.result` property set to `true` or `false` are returned. Events without a `products.jailbroken` Smart Signal result are left out of the response. (optional) + * @param bool $frida Filter events by Frida Detection result. > Note: When using this parameter, only events with the `products.frida.data.result` property set to `true` or `false` are returned. Events without a `products.frida` Smart Signal result are left out of the response. (optional) + * @param bool $factory_reset Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with the `products.factoryReset.data.result` property set to `true` or `false` are returned. Events without a `products.factoryReset` Smart Signal result are left out of the response. (optional) + * @param bool $cloned_app Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `products.clonedApp.data.result` property set to `true` or `false` are returned. Events without a `products.clonedApp` Smart Signal result are left out of the response. (optional) + * @param bool $emulator Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `products.emulator.data.result` property set to `true` or `false` are returned. Events without a `products.emulator` Smart Signal result are left out of the response. (optional) + * @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) * * @return array{ \Fingerprint\ServerAPI\Model\SearchEventsResponse|null, \Psr\Http\Message\ResponseInterface } * @@ -841,10 +855,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): 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): array { $returnType = '\Fingerprint\ServerAPI\Model\SearchEventsResponse'; - $request = $this->searchEventsRequest($limit, $pagination_key, $visitor_id, $bot, $ip_address, $linked_id, $start, $end, $reverse, $suspect); + $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); try { $options = $this->createHttpClientOption(); @@ -923,26 +937,40 @@ public function searchEvents(int $limit, ?string $pagination_key = null, ?string * * Get events via search * - * @param int $limit Limit the number of events returned. (required) - * @param string $pagination_key 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) - * @param string $visitor_id Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional) - * @param string $bot 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) - * @param string $ip_address 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) - * @param string $linked_id 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) - * @param int $start Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) - * @param int $end Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) - * @param bool $reverse Sort events in reverse timestamp order. (optional) - * @param bool $suspect 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. (optional) + * @param int $limit Limit the number of events returned. (required) + * @param string $pagination_key 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) + * @param string $visitor_id Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional) + * @param string $bot 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. > Note: When using this parameter, only events with the `products.botd.data.bot.result` property set to a valid value are returned. Events without a `products.botd` Smart Signal result are left out of the response. (optional) + * @param string $ip_address 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) + * @param string $linked_id 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) + * @param int $start Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) + * @param int $end Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) + * @param bool $reverse Sort events in reverse timestamp order. (optional) + * @param bool $suspect 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. (optional) + * @param bool $vpn Filter events by VPN Detection result. > Note: When using this parameter, only events with the `products.vpn.data.result` property set to `true` or `false` are returned. Events without a `products.vpn` Smart Signal result are left out of the response. (optional) + * @param bool $virtual_machine Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `products.virtualMachine.data.result` property set to `true` or `false` are returned. Events without a `products.virtualMachine` Smart Signal result are left out of the response. (optional) + * @param bool $tampering Filter events by Tampering Detection result. > Note: When using this parameter, only events with the `products.tampering.data.result` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) + * @param bool $anti_detect_browser Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `products.tampering.data.antiDetectBrowser` property set to `true` or `false` are returned. Events without a `products.tampering` Smart Signal result are left out of the response. (optional) + * @param bool $incognito Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `products.incognito.data.result` property set to `true` or `false` are returned. Events without a `products.incognito` Smart Signal result are left out of the response. (optional) + * @param bool $privacy_settings Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `products.privacySettings.data.result` property set to `true` or `false` are returned. Events without a `products.privacySettings` Smart Signal result are left out of the response. (optional) + * @param bool $jailbroken Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `products.jailbroken.data.result` property set to `true` or `false` are returned. Events without a `products.jailbroken` Smart Signal result are left out of the response. (optional) + * @param bool $frida Filter events by Frida Detection result. > Note: When using this parameter, only events with the `products.frida.data.result` property set to `true` or `false` are returned. Events without a `products.frida` Smart Signal result are left out of the response. (optional) + * @param bool $factory_reset Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with the `products.factoryReset.data.result` property set to `true` or `false` are returned. Events without a `products.factoryReset` Smart Signal result are left out of the response. (optional) + * @param bool $cloned_app Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `products.clonedApp.data.result` property set to `true` or `false` are returned. Events without a `products.clonedApp` Smart Signal result are left out of the response. (optional) + * @param bool $emulator Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `products.emulator.data.result` property set to `true` or `false` are returned. Events without a `products.emulator` Smart Signal result are left out of the response. (optional) + * @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) * * @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): 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): PromiseInterface { $returnType = '\Fingerprint\ServerAPI\Model\SearchEventsResponse'; - $request = $this->searchEventsRequest($limit, $pagination_key, $visitor_id, $bot, $ip_address, $linked_id, $start, $end, $reverse, $suspect); + $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); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1483,7 +1511,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): 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): Request { // verify the required parameter 'limit' is set if (null === $limit || (is_array($limit) && 0 === count($limit))) { @@ -1538,6 +1566,62 @@ protected function searchEventsRequest(int $limit, ?string $pagination_key = nul if (null !== $suspect) { $queryParams['suspect'] = ObjectSerializer::toQueryValue($suspect, null); } + // query params + if (null !== $vpn) { + $queryParams['vpn'] = ObjectSerializer::toQueryValue($vpn, null); + } + // query params + if (null !== $virtual_machine) { + $queryParams['virtual_machine'] = ObjectSerializer::toQueryValue($virtual_machine, null); + } + // query params + if (null !== $tampering) { + $queryParams['tampering'] = ObjectSerializer::toQueryValue($tampering, null); + } + // query params + if (null !== $anti_detect_browser) { + $queryParams['anti_detect_browser'] = ObjectSerializer::toQueryValue($anti_detect_browser, null); + } + // query params + if (null !== $incognito) { + $queryParams['incognito'] = ObjectSerializer::toQueryValue($incognito, null); + } + // query params + if (null !== $privacy_settings) { + $queryParams['privacy_settings'] = ObjectSerializer::toQueryValue($privacy_settings, null); + } + // query params + if (null !== $jailbroken) { + $queryParams['jailbroken'] = ObjectSerializer::toQueryValue($jailbroken, null); + } + // query params + if (null !== $frida) { + $queryParams['frida'] = ObjectSerializer::toQueryValue($frida, null); + } + // query params + if (null !== $factory_reset) { + $queryParams['factory_reset'] = ObjectSerializer::toQueryValue($factory_reset, null); + } + // query params + if (null !== $cloned_app) { + $queryParams['cloned_app'] = ObjectSerializer::toQueryValue($cloned_app, null); + } + // query params + if (null !== $emulator) { + $queryParams['emulator'] = ObjectSerializer::toQueryValue($emulator, null); + } + // query params + if (null !== $root_apps) { + $queryParams['root_apps'] = ObjectSerializer::toQueryValue($root_apps, null); + } + // query params + if (null !== $vpn_confidence) { + $queryParams['vpn_confidence'] = ObjectSerializer::toQueryValue($vpn_confidence, null); + } + // query params + if (null !== $min_suspect_score) { + $queryParams['min_suspect_score'] = ObjectSerializer::toQueryValue($min_suspect_score, 'float'); + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('Auth-API-Key'); diff --git a/src/Model/Tampering.php b/src/Model/Tampering.php index 0d7704ad..ca7478fd 100644 --- a/src/Model/Tampering.php +++ b/src/Model/Tampering.php @@ -219,7 +219,7 @@ public function getResult(): bool /** * Sets result. * - * @param bool $result Flag indicating browser tampering was detected. This happens when either of these conditions is true: * There are inconsistencies in the browser configuration that cross our internal tampering thresholds (indicated by `anomalyScore`). * The browser signature resembles one of \"anti-detect\" browsers specifically designed to evade identification and fingerprinting, for example, Incognition (indicated by `antiDetectBrowser`). + * @param bool $result Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. * * @return $this */ @@ -241,7 +241,7 @@ public function getAnomalyScore(): float /** * Sets anomaly_score. * - * @param float $anomaly_score Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate that there was a tampering attempt. * Values below `0.5` indicate genuine browsers. + * @param float $anomaly_score A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. * * @return $this */ @@ -263,7 +263,7 @@ public function getAntiDetectBrowser(): bool /** * Sets anti_detect_browser. * - * @param bool $anti_detect_browser Is `true` if the identified browser resembles one of \"anti-detect\" browsers, for example, Incognition. Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. + * @param bool $anti_detect_browser Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. * * @return $this */ diff --git a/src/Model/Webhook.php b/src/Model/Webhook.php index 38a0ad55..b7e5951e 100644 --- a/src/Model/Webhook.php +++ b/src/Model/Webhook.php @@ -55,6 +55,7 @@ class Webhook implements ModelInterface, \ArrayAccess 'request_id' => 'string', 'url' => 'string', 'ip' => 'string', + 'environment_id' => 'string', 'tag' => 'array', 'time' => '\DateTime', 'timestamp' => 'int', @@ -103,6 +104,7 @@ class Webhook implements ModelInterface, \ArrayAccess 'request_id' => null, 'url' => null, 'ip' => null, + 'environment_id' => null, 'tag' => null, 'time' => 'date-time', 'timestamp' => 'int64', @@ -152,6 +154,7 @@ class Webhook implements ModelInterface, \ArrayAccess 'request_id' => 'requestId', 'url' => 'url', 'ip' => 'ip', + 'environment_id' => 'environmentId', 'tag' => 'tag', 'time' => 'time', 'timestamp' => 'timestamp', @@ -200,6 +203,7 @@ class Webhook implements ModelInterface, \ArrayAccess 'request_id' => 'setRequestId', 'url' => 'setUrl', 'ip' => 'setIp', + 'environment_id' => 'setEnvironmentId', 'tag' => 'setTag', 'time' => 'setTime', 'timestamp' => 'setTimestamp', @@ -248,6 +252,7 @@ class Webhook implements ModelInterface, \ArrayAccess 'request_id' => 'getRequestId', 'url' => 'getUrl', 'ip' => 'getIp', + 'environment_id' => 'getEnvironmentId', 'tag' => 'getTag', 'time' => 'getTime', 'timestamp' => 'getTimestamp', @@ -305,6 +310,7 @@ public function __construct(?array $data = null) $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; $this->container['url'] = isset($data['url']) ? $data['url'] : null; $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + $this->container['environment_id'] = isset($data['environment_id']) ? $data['environment_id'] : null; $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; $this->container['time'] = isset($data['time']) ? $data['time'] : null; $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; @@ -508,6 +514,28 @@ public function setIp(string $ip): self return $this; } + /** + * Gets environment_id. + */ + public function getEnvironmentId(): ?string + { + return $this->container['environment_id']; + } + + /** + * Sets environment_id. + * + * @param ?string $environment_id environment ID of the event + * + * @return $this + */ + public function setEnvironmentId(?string $environment_id): self + { + $this->container['environment_id'] = $environment_id; + + return $this; + } + /** * Gets tag. */ diff --git a/src/Model/WebhookTampering.php b/src/Model/WebhookTampering.php index 79af829e..2f50d72d 100644 --- a/src/Model/WebhookTampering.php +++ b/src/Model/WebhookTampering.php @@ -207,7 +207,7 @@ public function getResult(): ?bool /** * Sets result. * - * @param ?bool $result Flag indicating browser tampering was detected. This happens when either of these conditions is true: * There are inconsistencies in the browser configuration that cross our internal tampering thresholds (indicated by `anomalyScore`). * The browser signature resembles one of \"anti-detect\" browsers specifically designed to evade identification and fingerprinting, for example, Incognition (indicated by `antiDetectBrowser`). + * @param ?bool $result Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. * * @return $this */ @@ -231,7 +231,7 @@ public function getAnomalyScore(): ?float /** * Sets anomaly_score. * - * @param ?double $anomaly_score Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate that there was a tampering attempt * Values below `0.5` indicate genuine browsers. + * @param ?double $anomaly_score A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. * * @return $this */ @@ -253,7 +253,7 @@ public function getAntiDetectBrowser(): ?bool /** * Sets anti_detect_browser. * - * @param ?bool $anti_detect_browser Is `true` if the identified browser resembles one of \"anti-detect\" browsers, for example, Incognition. Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. + * @param ?bool $anti_detect_browser Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. * * @return $this */ From 995f253effb63ae4680423f2955a41cb6d5223af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20Ayd=C4=B1n?= Date: Thu, 17 Apr 2025 19:28:06 +0300 Subject: [PATCH 2/3] test: update searchEvent test with new query parameter asserts Expanded the `searchEvent` test case to cover additional query parameters introduced in the new API version. Increased expected query parameter count from 11 to 25 (+14 filters). Added assertions for new parameters (`vpn`, `virtual_machine`, `tampering`, `anti_detect_browser`, `incognito`, `privacy_settings`, `jailbroken`, `frida`, `factory_reset`, `cloned_app`, `emulator`, `root_apps`, `vpn_confidence`, `min_suspect_score`). Updated the method call to include these new parameters. Related-Task: INTER-1213 --- test/FingerprintApiTest.php | 43 +++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/test/FingerprintApiTest.php b/test/FingerprintApiTest.php index dc9c0624..6db3911c 100644 --- a/test/FingerprintApiTest.php +++ b/test/FingerprintApiTest.php @@ -817,7 +817,7 @@ public function testSearchEventsWithAllParams() $this->mockHandler->append(function (RequestInterface $request) use ($end, $start) { $queryArray = []; parse_str($request->getUri()->getQuery(), $queryArray); - $this->assertCount(11, $queryArray); + $this->assertCount(25, $queryArray); $this->assertEquals('10', $queryArray['limit']); $this->assertEquals('pagination', $queryArray['pagination_key']); $this->assertEquals('true', $queryArray['reverse']); @@ -827,11 +827,50 @@ public function testSearchEventsWithAllParams() $this->assertEquals('true', $queryArray['suspect']); $this->assertEquals('good', $queryArray['bot']); $this->assertEquals('127.0.0.1/16', $queryArray['ip_address']); + $this->assertEquals('true', $queryArray['vpn']); + $this->assertEquals('true', $queryArray['virtual_machine']); + $this->assertEquals('true', $queryArray['tampering']); + $this->assertEquals('true', $queryArray['anti_detect_browser']); + $this->assertEquals('true', $queryArray['incognito']); + $this->assertEquals('true', $queryArray['privacy_settings']); + $this->assertEquals('true', $queryArray['jailbroken']); + $this->assertEquals('true', $queryArray['frida']); + $this->assertEquals('true', $queryArray['factory_reset']); + $this->assertEquals('true', $queryArray['cloned_app']); + $this->assertEquals('true', $queryArray['emulator']); + $this->assertEquals('true', $queryArray['root_apps']); + $this->assertEquals('medium', $queryArray['vpn_confidence']); + $this->assertEquals('0.5', $queryArray['min_suspect_score']); return $this->returnMockResponse('get_event_search_200.json'); }); - list($events) = $this->fingerprint_api->searchEvents(10, pagination_key: 'pagination', visitor_id: self::MOCK_VISITOR_ID, bot: 'good', ip_address: '127.0.0.1/16', linked_id: 'linked_id', start: $start->getTimestamp(), end: $end->getTimestamp(), reverse: true, suspect: true); + list($events) = $this->fingerprint_api->searchEvents( + 10, + pagination_key: 'pagination', + visitor_id: self::MOCK_VISITOR_ID, + bot: 'good', + ip_address: '127.0.0.1/16', + linked_id: 'linked_id', + start: $start->getTimestamp(), + end: $end->getTimestamp(), + reverse: true, + suspect: true, + vpn: true, + virtual_machine: true, + tampering: true, + anti_detect_browser: true, + incognito: true, + privacy_settings: true, + jailbroken: true, + frida: true, + factory_reset: true, + cloned_app: true, + emulator: true, + root_apps: true, + vpn_confidence: 'medium', + min_suspect_score: 0.5, + ); $this->assertCount(1, $events->getEvents()); $this->assertEquals('Ibk1527CUFmcnjLwIs4A9', $events->getEvents()[0]->getProducts()->getIdentification()->getData()->getVisitorId()); From b20f264a4a48daf0ffffa2f69ae66810f92bf796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20Ayd=C4=B1n?= Date: Fri, 18 Apr 2025 15:12:13 +0300 Subject: [PATCH 3/3] test: refactor query param assertions for maintainability Replaced individual assertions with a loop-based structure using a map to improve readability. Also included support for dynamically counting additional query parameters (`ii`, `visitor_id`) and added helpful failure messages to ease testing. Related-Task: INTER-1213 --- test/FingerprintApiTest.php | 58 ++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/test/FingerprintApiTest.php b/test/FingerprintApiTest.php index 6db3911c..232203d2 100644 --- a/test/FingerprintApiTest.php +++ b/test/FingerprintApiTest.php @@ -817,30 +817,40 @@ public function testSearchEventsWithAllParams() $this->mockHandler->append(function (RequestInterface $request) use ($end, $start) { $queryArray = []; parse_str($request->getUri()->getQuery(), $queryArray); - $this->assertCount(25, $queryArray); - $this->assertEquals('10', $queryArray['limit']); - $this->assertEquals('pagination', $queryArray['pagination_key']); - $this->assertEquals('true', $queryArray['reverse']); - $this->assertEquals('linked_id', $queryArray['linked_id']); - $this->assertEquals($start->getTimestamp(), $queryArray['start']); - $this->assertEquals($end->getTimestamp(), $queryArray['end']); - $this->assertEquals('true', $queryArray['suspect']); - $this->assertEquals('good', $queryArray['bot']); - $this->assertEquals('127.0.0.1/16', $queryArray['ip_address']); - $this->assertEquals('true', $queryArray['vpn']); - $this->assertEquals('true', $queryArray['virtual_machine']); - $this->assertEquals('true', $queryArray['tampering']); - $this->assertEquals('true', $queryArray['anti_detect_browser']); - $this->assertEquals('true', $queryArray['incognito']); - $this->assertEquals('true', $queryArray['privacy_settings']); - $this->assertEquals('true', $queryArray['jailbroken']); - $this->assertEquals('true', $queryArray['frida']); - $this->assertEquals('true', $queryArray['factory_reset']); - $this->assertEquals('true', $queryArray['cloned_app']); - $this->assertEquals('true', $queryArray['emulator']); - $this->assertEquals('true', $queryArray['root_apps']); - $this->assertEquals('medium', $queryArray['vpn_confidence']); - $this->assertEquals('0.5', $queryArray['min_suspect_score']); + + $expected = [ + 'limit' => '10', + 'pagination_key' => 'pagination', + 'reverse' => 'true', + 'linked_id' => 'linked_id', + 'start' => $start->getTimestamp(), + 'end' => $end->getTimestamp(), + 'suspect' => 'true', + 'bot' => 'good', + 'ip_address' => '127.0.0.1/16', + 'vpn' => 'true', + 'virtual_machine' => 'true', + 'tampering' => 'true', + 'anti_detect_browser' => 'true', + 'incognito' => 'true', + 'privacy_settings' => 'true', + 'jailbroken' => 'true', + 'frida' => 'true', + 'factory_reset' => 'true', + 'cloned_app' => 'true', + 'emulator' => 'true', + 'root_apps' => 'true', + 'vpn_confidence' => 'medium', + 'min_suspect_score' => '0.5', + ]; + + $extraKeys = ['ii', 'visitor_id']; + + $this->assertCount(count($expected) + count($extraKeys), $queryArray); + foreach ($expected as $query => $value) { + $this->assertArrayHasKey($query, $queryArray, "Missing query parameter: $query"); + $this->assertEquals($value, $queryArray[$query]); + } return $this->returnMockResponse('get_event_search_200.json'); });