Skip to content

Commit

Permalink
feat: update schema with correct IpLocation format and doc updates
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `IpLocation` and it's fields are optional now.
For `getVisits` method `before` argument is deprecated, use `paginationKey` instead.
  • Loading branch information
ilfa committed Jun 5, 2023
1 parent a73e826 commit 1c9b895
Show file tree
Hide file tree
Showing 81 changed files with 664 additions and 333 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public class FingerprintApiExample {
// An optional parameter limiting scanned results
private static final Integer LIMIT = 10;
// An optional parameter used to paginate results, see lastTimestamp
private static final Integer BEFORE = 1;
private static final String PAGINATION_KEY = "1683900801733.Ogvu1j";

public static void main(String... args) {
// Create a new api client instance from Configuration with your Fingerprint Pro Server API Key and your Fingerprint Pro Server API Region.
Expand All @@ -167,28 +167,28 @@ public class FingerprintApiExample {
// Get a specific visitor's all visits
try {
// Fetch all visits with a given visitorId, with a page limit
Response response = api.getVisits(FPJS_VISITOR_ID, null, null, LIMIT, null);
Response response = api.getVisits(FPJS_VISITOR_ID, null, null, LIMIT, null, null);
System.out.println(response.getVisits().toString());
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage());
System.err.println("Exception when calling FingerprintApi.getVisits:" + e.getMessage());
}

// Get a specific visitor's all visits with a linkedId
try {
// Fetch all visits with a given visitorId, with a page limit, skipping the first visit
Response response = api.getVisits(FPJS_VISITOR_ID, null, FPJS_LINKED_ID, LIMIT, BEFORE);
Response response = api.getVisits(FPJS_VISITOR_ID, null, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY, null);
System.out.println(response.getVisits().toString());
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage());
System.err.println("Exception when calling FingerprintApi.getVisits:" + e.getMessage());
}

// Use all the parameters on getVisits
try {
// Fetch the visitor's all visits with a given requestId and linkedId with a page limit while skipping the first visit
Response response = api.getVisits(FPJS_VISITOR_ID, FPJS_REQUEST_ID, FPJS_LINKED_ID, LIMIT, BEFORE);
Response response = api.getVisits(FPJS_VISITOR_ID, FPJS_REQUEST_ID, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY, null);
System.out.println(response.getVisits().toString());
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage());
System.err.println("Exception when calling FingerprintApi.getVisits:" + e.getMessage());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'eclipse'
apply plugin: 'com.diffplug.spotless'

group = 'com.fingerprint'
version = '1.0.0'
version = '1.1.0'

buildscript {
repositories {
Expand Down Expand Up @@ -37,7 +37,7 @@ publishing {
artifact jar
groupId 'com.fingerprint'
artifactId 'fingerprint-pro-server-api-sdk'
version '1.0.0'
version '1.1.0'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
artifactVersion: 1.0.0
artifactVersion: 1.1.0
apiPackage: com.fingerprint.api
modelPackage: com.fingerprint.model
invokerPackage: com.fingerprint.sdk
Expand Down
2 changes: 1 addition & 1 deletion docs/EventResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# EventResponse

Contains event from activated products - Fingerprint Pro or Bot Detection
Contains results from all activated products - Fingerprint Pro, Bot Detection, and others.

## Properties

Expand Down
50 changes: 31 additions & 19 deletions docs/FingerprintApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ All URIs are relative to *https://api.fpjs.io*
Get event by requestId

This endpoint allows you to get events with all the information from each activated product (Fingerprint Pro or Bot Detection). Use the requestId as a URL path :request_id parameter. This API method is scoped to a request, i.e. all returned information is by requestId.
This endpoint allows you to retrieve an individual analysis event with all the information from each activated product (Identification, Bot Detection, and others).
Products that are not activated for your application or not relevant to the event's detected platform (web, iOS, Android) are not included in the response.

Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`.


### Example

Expand Down Expand Up @@ -46,7 +50,7 @@ public class FingerprintApiExample {
*/
ApiClient client = Configuration.getDefaultApiClient(FPJS_API_SECRET, Region.EUROPE);
FingerprintApi api = new FingerprintApi(client);
String requestId = "requestId_example"; // String | requestId is the unique identifier of each request
String requestId = "requestId_example"; // String | The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request.
try {
EventResponse result = apiInstance.getEvent(requestId);
System.out.println(result);
Expand All @@ -63,7 +67,7 @@ public class FingerprintApiExample {

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

### Return type

Expand All @@ -83,16 +87,22 @@ public class FingerprintApiExample {
|-------------|-------------|------------------|
| **200** | OK | - |
| **403** | Forbidden | - |
| **404** | Bad Request | - |
| **404** | Not found | - |


## getVisits

> Response getVisits(visitorId, requestId, linkedId, limit, before)
> Response getVisits(visitorId, requestId, linkedId, limit, paginationKey, before)
Get visits by visitorId

This endpoint allows you to get a history of visits with all available information. Use the visitorId as a URL path parameter. This API method is scoped to a visitor, i.e. all returned information is by visitorId.
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.


### Example

Expand Down Expand Up @@ -122,13 +132,14 @@ public class FingerprintApiExample {
*/
ApiClient client = Configuration.getDefaultApiClient(FPJS_API_SECRET, Region.EUROPE);
FingerprintApi api = new FingerprintApi(client);
String visitorId = "uYIm7Ksp5rf00SllPhFp"; // String |
String requestId = "requestId_example"; // String | Filter visits by requestId
String linkedId = "linkedId_example"; // String | Filter visits by custom identifier
Integer limit = 56; // Integer | Limit scanned results
Long before = 56L; // Long | Timestamp (in milliseconds since epoch) used to paginate results
String visitorId = "uYIm7Ksp5rf00SllPhFp"; // String | Unique identifier of the visitor issued by Fingerprint Pro.
String requestId = "requestId_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.
String linkedId = "linkedId_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.
Integer limit = 56; // Integer | 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.
String paginationKey = "paginationKey_example"; // String | Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned.
Long before = 56L; // Long | ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results.
try {
Response result = apiInstance.getVisits(visitorIdrequestIdlinkedIdlimitbefore);
Response result = apiInstance.getVisits(visitorIdrequestIdlinkedIdlimitpaginationKeybefore);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FingerprintApi.getVisits:" + e.getMessage());
Expand All @@ -143,11 +154,12 @@ public class FingerprintApiExample {

| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **visitorId** | **String**| | |
| **requestId** | **String**| Filter visits by requestId | [optional] |
| **linkedId** | **String**| Filter visits by custom identifier | [optional] |
| **limit** | **Integer**| Limit scanned results | [optional] |
| **before** | **Long**| Timestamp (in milliseconds since epoch) used to paginate results | [optional] |
| **visitorId** | **String**| Unique identifier of the visitor issued by Fingerprint Pro. | |
| **requestId** | **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] |
| **linkedId** | **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** | **Integer**| 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] |
| **paginationKey** | **String**| Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. | [optional] |
| **before** | **Long**| ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. | [optional] |

### Return type

Expand All @@ -166,8 +178,8 @@ public class FingerprintApiExample {
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
| **403** | Forbidden. Probably ApiKey is missed or provided the wrong one. | - |
| **429** | Too Many Requests | * Retry-After - Indicates how long the user should wait before attempting the next request. <br> |
| **403** | Forbidden. The API Key is probably missing or incorrect. | - |
| **429** | Too Many Requests | * Retry-After - Indicates how long you should wait before attempting the next request. <br> |


## webhookTrace
Expand Down
12 changes: 6 additions & 6 deletions docs/IPLocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**accuracyRadius** | **Integer** | | |
|**latitude** | **Double** | | |
|**longitude** | **Double** | | |
|**accuracyRadius** | **Integer** | | [optional] |
|**latitude** | **Double** | | [optional] |
|**longitude** | **Double** | | [optional] |
|**postalCode** | **String** | | [optional] |
|**timezone** | **String** | | |
|**timezone** | **String** | | [optional] |
|**city** | [**IPLocationCity**](IPLocationCity.md) | | [optional] |
|**country** | [**Location**](Location.md) | | |
|**continent** | [**Location**](Location.md) | | |
|**country** | [**Location**](Location.md) | | [optional] |
|**continent** | [**Location**](Location.md) | | [optional] |
|**subdivisions** | [**List&lt;Subdivision&gt;**](Subdivision.md) | | [optional] |


Expand Down
2 changes: 1 addition & 1 deletion docs/ProductsResponseIdentificationData.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
|**browserDetails** | [**BrowserDetails**](BrowserDetails.md) | | |
|**incognito** | **Boolean** | Flag if user used incognito session. | |
|**ip** | **String** | | |
|**ipLocation** | [**IPLocation**](IPLocation.md) | | |
|**ipLocation** | [**IPLocation**](IPLocation.md) | | [optional] |
|**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | |
|**time** | **OffsetDateTime** | Time expressed according to ISO 8601 in UTC format. | |
|**url** | **URI** | Page URL from which identification request was sent. | |
Expand Down
4 changes: 2 additions & 2 deletions docs/Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Fields `lastTimestamp` and `paginationKey` added when `limit` or `before` parame
|------------ | ------------- | ------------- | -------------|
|**visitorId** | **String** | | |
|**visits** | [**List&lt;ResponseVisits&gt;**](ResponseVisits.md) | | |
|**lastTimestamp** | **Long** | When more results are available (e.g., you scanned 200 results using &#x60;limit&#x60; parameter, but a total of 600 results are available), a special &#x60;lastTimestamp&#x60; top-level attribute is added to the response. If you want to paginate the results further in the past, you should use the value of this attribute. | [optional] |
|**paginationKey** | **String** | Visit&#39;s &#x60;requestId&#x60; of the last visit in the current page. | [optional] |
|**lastTimestamp** | **Long** | ⚠️ Deprecated paging attribute, please use &#x60;paginationKey&#x60; instead. Timestamp of the last visit in the current page of results. | [optional] |
|**paginationKey** | **String** | Request ID of the last visit in the current page of results. Use this value in the following request as the &#x60;paginationKey&#x60; parameter to get the next page of results. | [optional] |



2 changes: 1 addition & 1 deletion docs/ResponseVisits.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
|**browserDetails** | [**BrowserDetails**](BrowserDetails.md) | | |
|**incognito** | **Boolean** | Flag if user used incognito session. | |
|**ip** | **String** | | |
|**ipLocation** | [**IPLocation**](IPLocation.md) | | |
|**ipLocation** | [**IPLocation**](IPLocation.md) | | [optional] |
|**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | |
|**time** | **OffsetDateTime** | Time expressed according to ISO 8601 in UTC format. | |
|**url** | **URI** | Page URL from which identification request was sent. | |
Expand Down
2 changes: 1 addition & 1 deletion docs/Visit.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
|**browserDetails** | [**BrowserDetails**](BrowserDetails.md) | | |
|**incognito** | **Boolean** | Flag if user used incognito session. | |
|**ip** | **String** | | |
|**ipLocation** | [**IPLocation**](IPLocation.md) | | |
|**ipLocation** | [**IPLocation**](IPLocation.md) | | [optional] |
|**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | |
|**time** | **OffsetDateTime** | Time expressed according to ISO 8601 in UTC format. | |
|**url** | **URI** | Page URL from which identification request was sent. | |
Expand Down
2 changes: 1 addition & 1 deletion docs/WebhookVisit.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
|**requestId** | **String** | Unique identifier of the user&#39;s identification request. | |
|**browserDetails** | [**BrowserDetails**](BrowserDetails.md) | | |
|**ip** | **String** | | |
|**ipLocation** | [**IPLocation**](IPLocation.md) | | |
|**ipLocation** | [**IPLocation**](IPLocation.md) | | [optional] |
|**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | |
|**time** | **OffsetDateTime** | Time expressed according to ISO 8601 in UTC format. | |
|**url** | **URI** | Page URL from which identification request was sent. | |
Expand Down
Loading

0 comments on commit 1c9b895

Please sign in to comment.