diff --git a/README.md b/README.md index 6e578c48..bc324463 100644 --- a/README.md +++ b/README.md @@ -95,11 +95,11 @@ from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY") api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) -visitor_id = 'visitor_id_example' # str | -#request_id = 'request_id_example' # str | Filter events by requestId (optional) -#linked_id = 'linked_id_example' # str | Filter events by custom identifier (optional) -limit = 10 # int | Limit scanned results (optional) -#before = 56 # int | Used to paginate results (optional) +visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. +#request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). +#linked_id = 'linked_id_example' # str | 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 = 10 # 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) +#pagination_key = 'pagination_key_example' # str | 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) try: api_response: Response = api_instance.get_visits(visitor_id, limit=2) @@ -108,7 +108,26 @@ except KnownApiException as e: structured_error = e.structured_error print("Error: %s\n" % structured_error.error) except ApiException as e: - print("Exception when calling DefaultApi->visitors_visitor_id_get: %s\n" % e) + print("Exception when calling FingerprintApi->visitors_visitor_id_get: %s\n" % e) +``` + +Delete visits using visitorId: +```python +import fingerprint_pro_server_api_sdk +from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException + +configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY") +api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) + +visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. + +try: + api_instance.delete_visitor_data(visitor_id) +except KnownApiException as e: + structured_error = e.structured_error + print("Error: %s\n" % structured_error.error) +except ApiException as e: + print("Exception when calling FingerprintApi->delete_visitor_data: %s\n" % e) ``` Fetching events for requestId: @@ -120,7 +139,7 @@ from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY") api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) -request_id = 'request_id_example' # str +request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). try: events_response: EventResponse = api_instance.get_event(request_id) @@ -129,7 +148,31 @@ except KnownApiException as e: structured_error = e.structured_error print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message)) except ApiException as e: - print("Exception when calling DefaultApi->get_event: %s\n" % e) + print("Exception when calling FingerprintApi->get_event: %s\n" % e) +``` + +Update event for requestId: +```python +import fingerprint_pro_server_api_sdk +from fingerprint_pro_server_api_sdk import EventUpdateRequest +from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException + +configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY") +api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) + +request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). +body = EventUpdateRequest(linked_id='foo') # EventUpdateRequest | +# body = EventUpdateRequest(tag={'bar': 123}) +# body = EventUpdateRequest(suspect=True) +# body = EventUpdateRequest(linked_id='foo', tag={'bar': 123}, suspect=False) + +try: + api_instance.update_event(request_id, body) +except KnownApiException as e: + structured_error = e.structured_error + print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message)) +except ApiException as e: + print("Exception when calling FingerprintApi->update_event: %s\n" % e) ``` ## Sealed results @@ -293,4 +336,4 @@ If you need private support, you can email us at [oss-support@fingerprint.com](m ## License -This project is licensed under the [MIT License](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/LICENSE). \ No newline at end of file +This project is licensed under the [MIT License](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/LICENSE). diff --git a/template/README.mustache b/template/README.mustache index 40484b9a..7d2c7e75 100644 --- a/template/README.mustache +++ b/template/README.mustache @@ -101,11 +101,11 @@ from {{packageName}}.rest import ApiException, KnownApiException configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") api_instance = {{packageName}}.FingerprintApi(configuration) -visitor_id = 'visitor_id_example' # str | -#request_id = 'request_id_example' # str | Filter events by requestId (optional) -#linked_id = 'linked_id_example' # str | Filter events by custom identifier (optional) -limit = 10 # int | Limit scanned results (optional) -#before = 56 # int | Used to paginate results (optional) +visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. +#request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). +#linked_id = 'linked_id_example' # str | 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 = 10 # 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) +#pagination_key = 'pagination_key_example' # str | 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) try: api_response: Response = api_instance.get_visits(visitor_id, limit=2) @@ -114,7 +114,26 @@ except KnownApiException as e: structured_error = e.structured_error print("Error: %s\n" % structured_error.error) except ApiException as e: - print("Exception when calling DefaultApi->visitors_visitor_id_get: %s\n" % e) + print("Exception when calling FingerprintApi->visitors_visitor_id_get: %s\n" % e) +``` + +Delete visits using visitorId: +```python +import {{packageName}} +from {{packageName}}.rest import ApiException, KnownApiException + +configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") +api_instance = {{packageName}}.FingerprintApi(configuration) + +visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. + +try: + api_instance.delete_visitor_data(visitor_id) +except KnownApiException as e: + structured_error = e.structured_error + print("Error: %s\n" % structured_error.error) +except ApiException as e: + print("Exception when calling FingerprintApi->delete_visitor_data: %s\n" % e) ``` Fetching events for requestId: @@ -126,7 +145,7 @@ from {{packageName}}.rest import ApiException, KnownApiException configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") api_instance = {{packageName}}.FingerprintApi(configuration) -request_id = 'request_id_example' # str +request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). try: events_response: EventResponse = api_instance.get_event(request_id) @@ -135,7 +154,31 @@ except KnownApiException as e: structured_error = e.structured_error print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message)) except ApiException as e: - print("Exception when calling DefaultApi->get_event: %s\n" % e) + print("Exception when calling FingerprintApi->get_event: %s\n" % e) +``` + +Update event for requestId: +```python +import {{packageName}} +from {{packageName}} import EventUpdateRequest +from {{packageName}}.rest import ApiException, KnownApiException + +configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") +api_instance = {{packageName}}.FingerprintApi(configuration) + +request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). +body = EventUpdateRequest(linked_id='foo') # EventUpdateRequest | +# body = EventUpdateRequest(tag={'bar': 123}) +# body = EventUpdateRequest(suspect=True) +# body = EventUpdateRequest(linked_id='foo', tag={'bar': 123}, suspect=False) + +try: + api_instance.update_event(request_id, body) +except KnownApiException as e: + structured_error = e.structured_error + print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message)) +except ApiException as e: + print("Exception when calling FingerprintApi->update_event: %s\n" % e) ``` ## Sealed results @@ -216,4 +259,4 @@ If you need private support, you can email us at [oss-support@fingerprint.com](m ## License -This project is licensed under the [MIT License](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/LICENSE). \ No newline at end of file +This project is licensed under the [MIT License](https://github.com/fingerprintjs/fingerprint-pro-server-api-python-sdk/blob/main/LICENSE).