Skip to content

Commit

Permalink
feat: new smart signals, put and delete endpoint, confidence score sc…
Browse files Browse the repository at this point in the history
…hema update

related issues: inter-849 inter-850 inter-851 inter-852
  • Loading branch information
Orkuncakilkaya committed Aug 21, 2024
1 parent 2a8be2e commit f823503
Show file tree
Hide file tree
Showing 72 changed files with 7,277 additions and 153 deletions.
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ if(!$isValidWebhookSign) {

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*FingerprintApi* | [**getEvent**](docs/Api/FingerprintApi.md#getevent) | **GET** /events/{request_id} | Get event by requestId
*FingerprintApi* | [**getVisits**](docs/Api/FingerprintApi.md#getvisits) | **GET** /visitors/{visitor_id} | Get visits by visitorId
*FingerprintApi* | [**deleteVisitorData**](docs/Api/FingerprintApi.md#deletevisitordata) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID
*FingerprintApi* | [**getEvent**](docs/Api/FingerprintApi.md#getevent) | **GET** /events/{request_id} | Get event by request ID
*FingerprintApi* | [**getVisits**](docs/Api/FingerprintApi.md#getvisits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID
*FingerprintApi* | [**updateEvent**](docs/Api/FingerprintApi.md#updateevent) | **PUT** /events/{request_id} | Update an event with a given request ID

## Documentation for Models

Expand All @@ -217,17 +219,29 @@ Class | Method | HTTP request | Description
- [BotdResult](docs/Model/BotdResult.md)
- [BrowserDetails](docs/Model/BrowserDetails.md)
- [ClonedAppResult](docs/Model/ClonedAppResult.md)
- [Common403ErrorResponse](docs/Model/Common403ErrorResponse.md)
- [Confidence](docs/Model/Confidence.md)
- [DataCenter](docs/Model/DataCenter.md)
- [DeprecatedIPLocation](docs/Model/DeprecatedIPLocation.md)
- [DeprecatedIPLocationCity](docs/Model/DeprecatedIPLocationCity.md)
- [DeveloperToolsResult](docs/Model/DeveloperToolsResult.md)
- [EmulatorResult](docs/Model/EmulatorResult.md)
- [ErrorEvent403Response](docs/Model/ErrorEvent403Response.md)
- [ErrorEvent403ResponseError](docs/Model/ErrorEvent403ResponseError.md)
- [ErrorCommon403Response](docs/Model/ErrorCommon403Response.md)
- [ErrorCommon429Response](docs/Model/ErrorCommon429Response.md)
- [ErrorCommon429ResponseError](docs/Model/ErrorCommon429ResponseError.md)
- [ErrorEvent404Response](docs/Model/ErrorEvent404Response.md)
- [ErrorEvent404ResponseError](docs/Model/ErrorEvent404ResponseError.md)
- [ErrorUpdateEvent400Response](docs/Model/ErrorUpdateEvent400Response.md)
- [ErrorUpdateEvent400ResponseError](docs/Model/ErrorUpdateEvent400ResponseError.md)
- [ErrorUpdateEvent409Response](docs/Model/ErrorUpdateEvent409Response.md)
- [ErrorUpdateEvent409ResponseError](docs/Model/ErrorUpdateEvent409ResponseError.md)
- [ErrorVisitor400Response](docs/Model/ErrorVisitor400Response.md)
- [ErrorVisitor400ResponseError](docs/Model/ErrorVisitor400ResponseError.md)
- [ErrorVisitor404Response](docs/Model/ErrorVisitor404Response.md)
- [ErrorVisitor404ResponseError](docs/Model/ErrorVisitor404ResponseError.md)
- [ErrorVisits403](docs/Model/ErrorVisits403.md)
- [EventResponse](docs/Model/EventResponse.md)
- [EventUpdateRequest](docs/Model/EventUpdateRequest.md)
- [FactoryResetResult](docs/Model/FactoryResetResult.md)
- [FridaResult](docs/Model/FridaResult.md)
- [HighActivityResult](docs/Model/HighActivityResult.md)
Expand All @@ -243,7 +257,6 @@ Class | Method | HTTP request | Description
- [JailbrokenResult](docs/Model/JailbrokenResult.md)
- [Location](docs/Model/Location.md)
- [LocationSpoofingResult](docs/Model/LocationSpoofingResult.md)
- [ManyRequestsResponse](docs/Model/ManyRequestsResponse.md)
- [PrivacySettingsResult](docs/Model/PrivacySettingsResult.md)
- [ProductError](docs/Model/ProductError.md)
- [ProductsResponse](docs/Model/ProductsResponse.md)
Expand All @@ -252,11 +265,13 @@ Class | Method | HTTP request | Description
- [ProductsResponseIdentificationData](docs/Model/ProductsResponseIdentificationData.md)
- [ProxyResult](docs/Model/ProxyResult.md)
- [RawDeviceAttributesResult](docs/Model/RawDeviceAttributesResult.md)
- [RemoteControlResult](docs/Model/RemoteControlResult.md)
- [Response](docs/Model/Response.md)
- [ResponseVisits](docs/Model/ResponseVisits.md)
- [RootAppsResult](docs/Model/RootAppsResult.md)
- [SeenAt](docs/Model/SeenAt.md)
- [SignalResponseClonedApp](docs/Model/SignalResponseClonedApp.md)
- [SignalResponseDeveloperTools](docs/Model/SignalResponseDeveloperTools.md)
- [SignalResponseEmulator](docs/Model/SignalResponseEmulator.md)
- [SignalResponseFactoryReset](docs/Model/SignalResponseFactoryReset.md)
- [SignalResponseFrida](docs/Model/SignalResponseFrida.md)
Expand All @@ -269,16 +284,22 @@ Class | Method | HTTP request | Description
- [SignalResponsePrivacySettings](docs/Model/SignalResponsePrivacySettings.md)
- [SignalResponseProxy](docs/Model/SignalResponseProxy.md)
- [SignalResponseRawDeviceAttributes](docs/Model/SignalResponseRawDeviceAttributes.md)
- [SignalResponseRemoteControl](docs/Model/SignalResponseRemoteControl.md)
- [SignalResponseRootApps](docs/Model/SignalResponseRootApps.md)
- [SignalResponseSuspectScore](docs/Model/SignalResponseSuspectScore.md)
- [SignalResponseTampering](docs/Model/SignalResponseTampering.md)
- [SignalResponseTor](docs/Model/SignalResponseTor.md)
- [SignalResponseVelocity](docs/Model/SignalResponseVelocity.md)
- [SignalResponseVirtualMachine](docs/Model/SignalResponseVirtualMachine.md)
- [SignalResponseVpn](docs/Model/SignalResponseVpn.md)
- [Subdivision](docs/Model/Subdivision.md)
- [SuspectScoreResult](docs/Model/SuspectScoreResult.md)
- [TamperingResult](docs/Model/TamperingResult.md)
- [TooManyRequestsResponse](docs/Model/TooManyRequestsResponse.md)
- [TorResult](docs/Model/TorResult.md)
- [VelocityIntervalResult](docs/Model/VelocityIntervalResult.md)
- [VelocityIntervals](docs/Model/VelocityIntervals.md)
- [VelocityResult](docs/Model/VelocityResult.md)
- [VirtualMachineResult](docs/Model/VirtualMachineResult.md)
- [Visit](docs/Model/Visit.md)
- [VpnResult](docs/Model/VpnResult.md)
Expand Down
146 changes: 136 additions & 10 deletions docs/Api/FingerprintApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,78 @@ All URIs are relative to *https://api.fpjs.io*

Method | HTTP request | Description
------------- | ------------- | -------------
[**getEvent**](FingerprintApi.md#getEvent) | **GET** /events/{request_id} | Get event by requestId
[**getVisits**](FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitorId
[**deleteVisitorData**](FingerprintApi.md#deleteVisitorData) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID
[**getEvent**](FingerprintApi.md#getEvent) | **GET** /events/{request_id} | Get event by request ID
[**getVisits**](FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID
[**updateEvent**](FingerprintApi.md#updateEvent) | **PUT** /events/{request_id} | Update an event with a given request ID

# **deleteVisitorData**
> deleteVisitorData($visitor_id)
Delete data by visitor ID

Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. All delete requests are queued: * Recent data (10 days or newer) belonging to the specified visitor will be deleted within 24 hours. * Data from older (11 days or more) identification events will be deleted after 90 days. If you are interested in using this API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403.

### Example
```php
<?php

require_once(__DIR__ . '/vendor/autoload.php');

const FPJS_API_SECRET = "Your Fingerprint Secret API Key"; // Fingerprint Secret API Key

// Import Fingerprint Classes and Guzzle HTTP Client
use Fingerprint\ServerAPI\Api\FingerprintApi;
use Fingerprint\ServerAPI\Configuration;
use GuzzleHttp\Client;

// Create new Configuration instance with defaultValues, added our API Secret and our Region
$config = Configuration::getDefaultConfiguration(FPJS_API_SECRET, Configuration::REGION_EUROPE);
$client = new FingerprintApi(
new Client(),
$config
);

$visitor_id = "visitor_id_example"; // string | The [visitor ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to delete.

try {
$client->deleteVisitorData($visitor_id);
} catch (Exception $e) {
echo 'Exception when calling FingerprintApi->deleteVisitorData: ', $e->getMessage(), PHP_EOL;
}
?>
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**visitor_id** | **string**| The [visitor ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to delete. |

### Return type

Array:
0. null,
1. \Psr\Http\Message\ResponseInterface


### Authorization

[ApiKeyHeader](../../README.md#ApiKeyHeader), [ApiKeyQuery](../../README.md#ApiKeyQuery)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

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

# **getEvent**
> [ \Fingerprint\ServerAPI\Model\EventResponse, \Psr\Http\Message\ResponseInterface ] getEvent($request_id)
Get event by requestId
Get event by request ID

This endpoint allows you to get a detailed analysis of an individual request. **Only for Enterprise customers:** Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`.
Get a detailed analysis of an individual identification event, including Smart Signals. Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`.

### Example
```php
Expand All @@ -34,7 +97,7 @@ $client = new FingerprintApi(
$config
);

$request_id = "request_id_example"; // string | The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request.
$request_id = "request_id_example"; // string | The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request.

try {
list($model, $httpResponse) = $client->getEvent($request_id);
Expand All @@ -49,7 +112,7 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**request_id** | **string**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. |
**request_id** | **string**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. |

### Return type

Expand All @@ -72,9 +135,9 @@ Array:
# **getVisits**
> [ \Fingerprint\ServerAPI\Model\Response, \Psr\Http\Message\ResponseInterface ] getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before)
Get visits by visitorId
Get visits by visitor ID

This endpoint allows you to get a history of visits for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received.
Get a history of visits (identification events) for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received.

### Example
```php
Expand All @@ -96,7 +159,7 @@ $client = new FingerprintApi(
$config
);

$visitor_id = "visitor_id_example"; // string | Unique identifier of the visitor issued by Fingerprint Pro.
$visitor_id = "visitor_id_example"; // string | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro.
$request_id = "request_id_example"; // string | Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned.
$linked_id = "linked_id_example"; // string | Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#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.
$limit = 56; // int | Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500.
Expand All @@ -116,7 +179,7 @@ try {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**visitor_id** | **string**| Unique identifier of the visitor issued by Fingerprint Pro. |
**visitor_id** | **string**| Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. |
**request_id** | **string**| Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. | [optional]
**linked_id** | **string**| Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#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]
**limit** | **int**| Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. | [optional]
Expand All @@ -141,3 +204,66 @@ 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)

# **updateEvent**
> updateEvent($body, $request_id)
Update an event with a given request ID

Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days.

### Example
```php
<?php

require_once(__DIR__ . '/vendor/autoload.php');

const FPJS_API_SECRET = "Your Fingerprint Secret API Key"; // Fingerprint Secret API Key

// Import Fingerprint Classes and Guzzle HTTP Client
use Fingerprint\ServerAPI\Api\FingerprintApi;
use Fingerprint\ServerAPI\Configuration;
use GuzzleHttp\Client;

// Create new Configuration instance with defaultValues, added our API Secret and our Region
$config = Configuration::getDefaultConfiguration(FPJS_API_SECRET, Configuration::REGION_EUROPE);
$client = new FingerprintApi(
new Client(),
$config
);

$body = new \Fingerprint\ServerAPI\Model\EventUpdateRequest(); // \Fingerprint\ServerAPI\Model\EventUpdateRequest |
$request_id = "request_id_example"; // string | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid).

try {
$client->updateEvent($body, $request_id);
} catch (Exception $e) {
echo 'Exception when calling FingerprintApi->updateEvent: ', $e->getMessage(), PHP_EOL;
}
?>
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**\Fingerprint\ServerAPI\Model\EventUpdateRequest**](../Model/EventUpdateRequest.md)| |
**request_id** | **string**| The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). |

### Return type

Array:
0. null,
1. \Psr\Http\Message\ResponseInterface


### Authorization

[ApiKeyHeader](../../README.md#ApiKeyHeader), [ApiKeyQuery](../../README.md#ApiKeyQuery)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

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

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# ErrorEvent403ResponseError
# Common403ErrorResponse

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **string** | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - subscription not found for specified secret key * `SubscriptionNotActive` - subscription is not active * `WrongRegion` - server and subscription region differ |
**code** | **string** | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - No Fingerprint application found for specified secret key * `SubscriptionNotActive` - Fingerprint application is not active * `WrongRegion` - server and application region differ * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application |
**message** | **string** | |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
Expand Down
1 change: 1 addition & 0 deletions docs/Model/Confidence.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**score** | **float** | The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. |
**revision** | **string** | The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. | [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)

9 changes: 9 additions & 0 deletions docs/Model/DeveloperToolsResult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# DeveloperToolsResult

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | **bool** | `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. |

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

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# ErrorEvent403Response
# ErrorCommon403Response

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | [**\Fingerprint\ServerAPI\Model\ErrorEvent403ResponseError**](ErrorEvent403ResponseError.md) | | [optional]
**error** | [**\Fingerprint\ServerAPI\Model\Common403ErrorResponse**](Common403ErrorResponse.md) | | [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)

Loading

0 comments on commit f823503

Please sign in to comment.