Skip to content

Latest commit

 

History

History
198 lines (142 loc) · 7.53 KB

SearchApi.md

File metadata and controls

198 lines (142 loc) · 7.53 KB

firefly_iii_client.SearchApi

All URIs are relative to https://demo.firefly-iii.org/api

Method HTTP request Description
search_accounts GET /v1/search/accounts Search for accounts
search_transactions GET /v1/search/transactions Search for transactions

search_accounts

AccountArray search_accounts(query, field, x_trace_id=x_trace_id, limit=limit, page=page, type=type)

Search for accounts

Search for accounts

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.account_array import AccountArray
from firefly_iii_client.models.account_search_field_filter import AccountSearchFieldFilter
from firefly_iii_client.models.account_type_filter import AccountTypeFilter
from firefly_iii_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://demo.firefly-iii.org/api
# See configuration.py for a list of all supported configuration parameters.
configuration = firefly_iii_client.Configuration(
    host = "https://demo.firefly-iii.org/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: local_bearer_auth
configuration = firefly_iii_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with firefly_iii_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = firefly_iii_client.SearchApi(api_client)
    query = 'checking' # str | The query you wish to search for.
    field = firefly_iii_client.AccountSearchFieldFilter() # AccountSearchFieldFilter | The account field(s) you want to search in.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)
    limit = 10 # int | Number of items per page. The default pagination is per 50 items. (optional)
    page = 1 # int | Page number. The default pagination is per 50 items. (optional)
    type = firefly_iii_client.AccountTypeFilter() # AccountTypeFilter | The type of accounts you wish to limit the search to. (optional)

    try:
        # Search for accounts
        api_response = api_instance.search_accounts(query, field, x_trace_id=x_trace_id, limit=limit, page=page, type=type)
        print("The response of SearchApi->search_accounts:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SearchApi->search_accounts: %s\n" % e)

Parameters

Name Type Description Notes
query str The query you wish to search for.
field AccountSearchFieldFilter The account field(s) you want to search in.
x_trace_id str Unique identifier associated with this request. [optional]
limit int Number of items per page. The default pagination is per 50 items. [optional]
page int Page number. The default pagination is per 50 items. [optional]
type AccountTypeFilter The type of accounts you wish to limit the search to. [optional]

Return type

AccountArray

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json, application/json

HTTP response details

Status code Description Response headers
200 A list of accounts. -
400 Bad request -
401 Unauthenticated -
404 Page not found -
500 Internal exception -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

search_transactions

TransactionArray search_transactions(query, x_trace_id=x_trace_id, limit=limit, page=page)

Search for transactions

Searches through the users transactions.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.transaction_array import TransactionArray
from firefly_iii_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://demo.firefly-iii.org/api
# See configuration.py for a list of all supported configuration parameters.
configuration = firefly_iii_client.Configuration(
    host = "https://demo.firefly-iii.org/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: local_bearer_auth
configuration = firefly_iii_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with firefly_iii_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = firefly_iii_client.SearchApi(api_client)
    query = 'groceries' # str | The query you wish to search for.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)
    limit = 10 # int | Number of items per page. The default pagination is per 50 items. (optional)
    page = 1 # int | Page number. The default pagination is per 50 items. (optional)

    try:
        # Search for transactions
        api_response = api_instance.search_transactions(query, x_trace_id=x_trace_id, limit=limit, page=page)
        print("The response of SearchApi->search_transactions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SearchApi->search_transactions: %s\n" % e)

Parameters

Name Type Description Notes
query str The query you wish to search for.
x_trace_id str Unique identifier associated with this request. [optional]
limit int Number of items per page. The default pagination is per 50 items. [optional]
page int Page number. The default pagination is per 50 items. [optional]

Return type

TransactionArray

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json, application/json

HTTP response details

Status code Description Response headers
200 A list of transactions. -
400 Bad request -
401 Unauthenticated -
404 Page not found -
500 Internal exception -

[Back to top] [Back to API list] [Back to Model list] [Back to README]