Skip to content

Commit

Permalink
docs(README): add examples to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUnderScorer committed Sep 13, 2022
1 parent e5b110d commit 13256fd
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 6 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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*
Expand Down
43 changes: 37 additions & 6 deletions template/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}}*
Expand Down

0 comments on commit 13256fd

Please sign in to comment.