From 13256fd34a1275c9c3a9ca8c01cd5beb1fafa668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Tue, 13 Sep 2022 11:45:50 +0100 Subject: [PATCH] docs(README): add examples to readme --- README.md | 31 +++++++++++++++++++++++++++++ template/README.mustache | 43 ++++++++++++++++++++++++++++++++++------ 2 files changed, 68 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b5f203f7..92972cd8 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,19 @@ configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API # create an instance of the API class api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) +``` + +## Examples + +Fetching visits using visitorId: +```python +import fingerprint_pro_server_api_sdk +from fingerprint_pro_server_api_sdk import Response +from fingerprint_pro_server_api_sdk.rest import ApiException + +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) @@ -103,6 +116,24 @@ except ApiException as e: print("Exception when calling DefaultApi->visitors_visitor_id_get: %s\n" % e) ``` +Fetching events for requestId: +```python +import fingerprint_pro_server_api_sdk +from fingerprint_pro_server_api_sdk import EventResponse +from fingerprint_pro_server_api_sdk.rest import ApiException + +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 + +try: + events_response: EventResponse = api_instance.get_event(request_id) + +except ApiException as e: + print("Exception when calling DefaultApi->get_event: %s\n" % e) +``` + ## Documentation for API Endpoints All URIs are relative to *https://api.fpjs.io* diff --git a/template/README.mustache b/template/README.mustache index 8d4b6f8a..b4d83638 100644 --- a/template/README.mustache +++ b/template/README.mustache @@ -88,16 +88,29 @@ import {{{packageName}}} Please follow the [installation procedure](#installation--usage) and then run the following: ```python -import {{{packageName}}} -from {{{packageName}}} import Response -from {{{packageName}}}.rest import ApiException +import {{packageName}} +from {{packageName}} import Response +from {{packageName}}.rest import ApiException # Configure API key authorization and region -configuration = {{{packageName}}}.Configuration(api_key="SECRET_API_KEY") -# configuration = {{{packageName}}}.Configuration(api_key="SECRET_API_KEY", region="eu") +configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") +# configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY", region="eu") # create an instance of the API class -api_instance = {{{packageName}}}.FingerprintApi(configuration) +api_instance = {{packageName}}.FingerprintApi(configuration) +``` + +## Examples + +Fetching visits using visitorId: +```python +import {{packageName}} +from {{packageName}} import Response +from {{packageName}}.rest import ApiException + +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) @@ -111,6 +124,24 @@ except ApiException as e: print("Exception when calling DefaultApi->visitors_visitor_id_get: %s\n" % e) ``` +Fetching events for requestId: +```python +import {{packageName}} +from {{packageName}} import EventResponse +from {{packageName}}.rest import ApiException + +configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") +api_instance = {{packageName}}.FingerprintApi(configuration) + +request_id = 'request_id_example' # str + +try: + events_response: EventResponse = api_instance.get_event(request_id) + +except ApiException as e: + print("Exception when calling DefaultApi->get_event: %s\n" % e) +``` + ## Documentation for API Endpoints All URIs are relative to *{{basePath}}*