Skip to content

Commit 90f3bb1

Browse files
docs(api): add fingerprint api doc
1 parent 650b7b5 commit 90f3bb1

File tree

2 files changed

+163
-84
lines changed

2 files changed

+163
-84
lines changed

docs/Api/FingerprintApi.md

Lines changed: 88 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -4,91 +4,95 @@ All URIs are relative to *https://api.fpjs.io*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7-
[**getEvent**](FingerprintApi.md#getevent) | **GET** /events/{request_id} | Get event by requestId
8-
[**getVisits**](FingerprintApi.md#getvisits) | **GET** /visitors/{visitor_id} | Get visits by visitorId
7+
[**getEvent**](FingerprintApi.md#getEvent) | **GET** /events/{request_id} | Get event by requestId
8+
[**getVisits**](FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitorId
99

10-
# **getEvent**
11-
> \Fingerprint\ServerAPI\Model\EventResponse getEvent($request_id)
10+
# **getEvent**
11+
> \Fingerprint\ServerAPI\Model\EventResponse getEvent($request_id)
1212

13-
Get event by requestId
13+
Get event by requestId
1414

15-
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`.
15+
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`.
16+
17+
### Example
18+
```php
19+
<?php
1620

17-
### Example
18-
```php
19-
<?php
2021
require_once(__DIR__ . '/vendor/autoload.php');
21-
// Configure API key authorization: ApiKeyHeader
22-
$config = Fingerprint\ServerAPI\Configuration::getDefaultConfiguration()->setApiKey('Auth-API-Key', 'YOUR_API_KEY');
23-
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
24-
// $config = Fingerprint\ServerAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Auth-API-Key', 'Bearer');// Configure API key authorization: ApiKeyQuery
25-
$config = Fingerprint\ServerAPI\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
26-
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
27-
// $config = Fingerprint\ServerAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
28-
29-
$apiInstance = new Fingerprint\ServerAPI\Api\FingerprintApi(
30-
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
31-
// This is optional, `GuzzleHttp\Client` will be used as default.
32-
new GuzzleHttp\Client(),
22+
23+
const FPJS_API_SECRET = "Your Fingerprint Secret API Key"; // Fingerprint Secret API Key
24+
25+
// Import Fingerprint Classes and Guzzle HTTP Client
26+
use Fingerprint\ServerAPI\Api\FingerprintApi;
27+
use Fingerprint\ServerAPI\Configuration;
28+
use GuzzleHttp\Client;
29+
30+
// Create new Configuration instance with defaultValues, added our API Secret and our Region
31+
$config = Configuration::getDefaultConfiguration(FPJS_API_SECRET, Configuration::REGION_EUROPE);
32+
$client = new FingerprintApi(
33+
new Client(),
3334
$config
3435
);
36+
3537
$request_id = "request_id_example"; // string | The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request.
3638

3739
try {
38-
$result = $apiInstance->getEvent($request_id);
39-
print_r($result);
40-
} catch (Exception $e) {
41-
echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL;
42-
}
43-
?>
44-
```
40+
$result = $client->getEvent($request_id);
41+
echo "<pre>" . $response->__toString() . "</pre>";
42+
} catch (Exception $e) {
43+
echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL;
44+
}
45+
?>
46+
```
4547

46-
### Parameters
48+
### Parameters
49+
50+
Name | Type | Description | Notes
51+
------------- | ------------- | ------------- | -------------
52+
**request_id** | **string**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. |
4753

48-
Name | Type | Description | Notes
49-
------------- | ------------- | ------------- | -------------
50-
**request_id** | **string**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. |
54+
### Return type
5155

52-
### Return type
56+
[**\Fingerprint\ServerAPI\Model\EventResponse**](../Model/EventResponse.md)
5357

54-
[**\Fingerprint\ServerAPI\Model\EventResponse**](../Model/EventResponse.md)
58+
### Authorization
5559

56-
### Authorization
60+
[ApiKeyHeader](../../README.md#ApiKeyHeader), [ApiKeyQuery](../../README.md#ApiKeyQuery)
5761

58-
[ApiKeyHeader](../../README.md#ApiKeyHeader), [ApiKeyQuery](../../README.md#ApiKeyQuery)
62+
### HTTP request headers
5963

60-
### HTTP request headers
64+
- **Content-Type**: Not defined
65+
- **Accept**: application/json
6166

62-
- **Content-Type**: Not defined
63-
- **Accept**: application/json
67+
[[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)
6468

65-
[[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)
69+
# **getVisits**
70+
> \Fingerprint\ServerAPI\Model\Response getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before)
6671

67-
# **getVisits**
68-
> \Fingerprint\ServerAPI\Model\Response getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before)
72+
Get visits by visitorId
6973

70-
Get visits by visitorId
74+
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.
7175

72-
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.
76+
### Example
77+
```php
78+
<?php
7379

74-
### Example
75-
```php
76-
<?php
7780
require_once(__DIR__ . '/vendor/autoload.php');
78-
// Configure API key authorization: ApiKeyHeader
79-
$config = Fingerprint\ServerAPI\Configuration::getDefaultConfiguration()->setApiKey('Auth-API-Key', 'YOUR_API_KEY');
80-
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
81-
// $config = Fingerprint\ServerAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Auth-API-Key', 'Bearer');// Configure API key authorization: ApiKeyQuery
82-
$config = Fingerprint\ServerAPI\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
83-
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
84-
// $config = Fingerprint\ServerAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
85-
86-
$apiInstance = new Fingerprint\ServerAPI\Api\FingerprintApi(
87-
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
88-
// This is optional, `GuzzleHttp\Client` will be used as default.
89-
new GuzzleHttp\Client(),
81+
82+
const FPJS_API_SECRET = "Your Fingerprint Secret API Key"; // Fingerprint Secret API Key
83+
84+
// Import Fingerprint Classes and Guzzle HTTP Client
85+
use Fingerprint\ServerAPI\Api\FingerprintApi;
86+
use Fingerprint\ServerAPI\Configuration;
87+
use GuzzleHttp\Client;
88+
89+
// Create new Configuration instance with defaultValues, added our API Secret and our Region
90+
$config = Configuration::getDefaultConfiguration(FPJS_API_SECRET, Configuration::REGION_EUROPE);
91+
$client = new FingerprintApi(
92+
new Client(),
9093
$config
9194
);
95+
9296
$visitor_id = "visitor_id_example"; // string | Unique identifier of the visitor issued by Fingerprint Pro.
9397
$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.
9498
$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.
@@ -97,37 +101,37 @@ $pagination_key = "pagination_key_example"; // string | Use `paginationKey` to g
97101
$before = 789; // int | ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results.
98102

99103
try {
100-
$result = $apiInstance->getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before);
101-
print_r($result);
102-
} catch (Exception $e) {
103-
echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL;
104-
}
105-
?>
106-
```
107-
108-
### Parameters
104+
$result = $client->getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before);
105+
echo "<pre>" . $response->__toString() . "</pre>";
106+
} catch (Exception $e) {
107+
echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL;
108+
}
109+
?>
110+
```
109111

110-
Name | Type | Description | Notes
111-
------------- | ------------- | ------------- | -------------
112-
**visitor_id** | **string**| Unique identifier of the visitor issued by Fingerprint Pro. |
113-
**request_id** | **string**| Filter visits by &#x60;requestId&#x60;. Every identification request has a unique identifier associated with it called &#x60;requestId&#x60;. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by &#x60;requestId&#x60;, only one visit will be returned. | [optional]
114-
**linked_id** | **string**| Filter visits by your custom identifier. You can use [&#x60;linkedId&#x60;](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 &#x60;linked_id&#x60; parameter to retrieve all events associated with your custom identifier. | [optional]
115-
**limit** | **int**| Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use &#x60;limit&#x60; to specify how many events are scanned before they are filtered by &#x60;requestId&#x60; or &#x60;linkedId&#x60;. 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]
116-
**pagination_key** | **string**| Use &#x60;paginationKey&#x60; to get the next page of results. When more results are available (e.g., you requested 200 results using &#x60;limit&#x60; parameter, but a total of 600 results are available), the &#x60;paginationKey&#x60; top-level attribute is added to the response. The key corresponds to the &#x60;requestId&#x60; of the last returned event. In the following request, use that value in the &#x60;paginationKey&#x60; parameter to get the next page of results: 1. First request, returning most recent 200 events: &#x60;GET api-base-url/visitors/:visitorId?limit&#x3D;200&#x60; 2. Use &#x60;response.paginationKey&#x60; to get the next page of results: &#x60;GET api-base-url/visitors/:visitorId?limit&#x3D;200&amp;paginationKey&#x3D;1683900801733.Ogvu1j&#x60; Pagination happens during scanning and before filtering, so you can get less visits than the &#x60;limit&#x60; you specified with more available on the next page. When there are no more results available for scanning, the &#x60;paginationKey&#x60; attribute is not returned. | [optional]
117-
**before** | **int**| ⚠️ Deprecated pagination method, please use &#x60;paginationKey&#x60; instead. Timestamp (in milliseconds since epoch) used to paginate results. | [optional]
112+
### Parameters
113+
114+
Name | Type | Description | Notes
115+
------------- | ------------- | ------------- | -------------
116+
**visitor_id** | **string**| Unique identifier of the visitor issued by Fingerprint Pro. |
117+
**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]
118+
**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]
119+
**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]
120+
**pagination_key** | **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]
121+
**before** | **int**| ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. | [optional]
118122

119-
### Return type
123+
### Return type
120124

121-
[**\Fingerprint\ServerAPI\Model\Response**](../Model/Response.md)
125+
[**\Fingerprint\ServerAPI\Model\Response**](../Model/Response.md)
122126

123-
### Authorization
127+
### Authorization
124128

125-
[ApiKeyHeader](../../README.md#ApiKeyHeader), [ApiKeyQuery](../../README.md#ApiKeyQuery)
129+
[ApiKeyHeader](../../README.md#ApiKeyHeader), [ApiKeyQuery](../../README.md#ApiKeyQuery)
126130

127-
### HTTP request headers
131+
### HTTP request headers
128132

129-
- **Content-Type**: Not defined
130-
- **Accept**: application/json
133+
- **Content-Type**: Not defined
134+
- **Accept**: application/json
131135

132-
[[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)
136+
[[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)
133137

template/api_doc.mustache

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# {{invokerPackage}}\FingerprintApi{{#description}}
2+
{{description}}{{/description}}
3+
4+
All URIs are relative to *{{basePath}}*
5+
6+
Method | HTTP request | Description
7+
------------- | ------------- | -------------
8+
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
9+
{{/operation}}{{/operations}}
10+
11+
{{#operations}}
12+
{{#operation}}
13+
# **{{{operationId}}}**
14+
> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
15+
16+
{{{summary}}}{{#notes}}
17+
18+
{{{notes}}}{{/notes}}
19+
20+
### Example
21+
```php
22+
<?php
23+
24+
require_once(__DIR__ . '/vendor/autoload.php');
25+
26+
const FPJS_API_SECRET = "Your Fingerprint Secret API Key"; // Fingerprint Secret API Key
27+
28+
// Import Fingerprint Classes and Guzzle HTTP Client
29+
use Fingerprint\ServerAPI\Api\FingerprintApi;
30+
use Fingerprint\ServerAPI\Configuration;
31+
use GuzzleHttp\Client;
32+
33+
// Create new Configuration instance with defaultValues, added our API Secret and our Region
34+
$config = Configuration::getDefaultConfiguration(FPJS_API_SECRET, Configuration::REGION_EUROPE);
35+
$client = new FingerprintApi(
36+
new Client(),
37+
$config
38+
);
39+
40+
{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
41+
{{/allParams}}
42+
43+
try {
44+
{{#returnType}}$result = {{/returnType}}$client->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
45+
echo "<pre>" . $response->__toString() . "</pre>";{{/returnType}}
46+
} catch (Exception $e) {
47+
echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL;
48+
}
49+
?>
50+
```
51+
52+
### Parameters
53+
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#@last}}
54+
Name | Type | Description | Notes
55+
------------- | ------------- | ------------- | -------------{{/@last}}{{/allParams}}
56+
{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{{description}}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}
57+
{{/allParams}}
58+
59+
### Return type
60+
61+
{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**](../Model/{{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
62+
63+
### Authorization
64+
65+
{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../../README.md#{{{name}}}){{^@last}}, {{/@last}}{{/authMethods}}
66+
67+
### HTTP request headers
68+
69+
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
70+
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
71+
72+
[[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)
73+
74+
{{/operation}}
75+
{{/operations}}

0 commit comments

Comments
 (0)