Skip to content

Latest commit

 

History

History
648 lines (462 loc) · 24 KB

CategoriesApi.md

File metadata and controls

648 lines (462 loc) · 24 KB

firefly_iii_client.CategoriesApi

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

Method HTTP request Description
delete_category DELETE /v1/categories/{id} Delete a category.
get_category GET /v1/categories/{id} Get a single category.
list_attachment_by_category GET /v1/categories/{id}/attachments Lists all attachments.
list_category GET /v1/categories List all categories.
list_transaction_by_category GET /v1/categories/{id}/transactions List all transactions in a category.
store_category POST /v1/categories Store a new category
update_category PUT /v1/categories/{id} Update existing category.

delete_category

delete_category(id, x_trace_id=x_trace_id)

Delete a category.

Delete a category. Transactions will not be removed.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
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.CategoriesApi(api_client)
    id = '123' # str | The ID of the category.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)

    try:
        # Delete a category.
        api_instance.delete_category(id, x_trace_id=x_trace_id)
    except Exception as e:
        print("Exception when calling CategoriesApi->delete_category: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the category.
x_trace_id str Unique identifier associated with this request. [optional]

Return type

void (empty response body)

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Category deleted. -
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]

get_category

CategorySingle get_category(id, x_trace_id=x_trace_id, start=start, end=end)

Get a single category.

Get a single category.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.category_single import CategorySingle
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.CategoriesApi(api_client)
    id = '123' # str | The ID of the category.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)
    start = 'Mon Sep 17 00:00:00 UTC 2018' # date | A date formatted YYYY-MM-DD, to show spent and earned info.  (optional)
    end = 'Mon Dec 31 00:00:00 UTC 2018' # date | A date formatted YYYY-MM-DD, to show spent and earned info.  (optional)

    try:
        # Get a single category.
        api_response = api_instance.get_category(id, x_trace_id=x_trace_id, start=start, end=end)
        print("The response of CategoriesApi->get_category:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoriesApi->get_category: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the category.
x_trace_id str Unique identifier associated with this request. [optional]
start date A date formatted YYYY-MM-DD, to show spent and earned info. [optional]
end date A date formatted YYYY-MM-DD, to show spent and earned info. [optional]

Return type

CategorySingle

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 The requested category -
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]

list_attachment_by_category

AttachmentArray list_attachment_by_category(id, x_trace_id=x_trace_id, limit=limit, page=page)

Lists all attachments.

Lists all attachments.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.attachment_array import AttachmentArray
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.CategoriesApi(api_client)
    id = '123' # str | The ID of the category.
    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:
        # Lists all attachments.
        api_response = api_instance.list_attachment_by_category(id, x_trace_id=x_trace_id, limit=limit, page=page)
        print("The response of CategoriesApi->list_attachment_by_category:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoriesApi->list_attachment_by_category: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the category.
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

AttachmentArray

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 attachments -
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]

list_category

CategoryArray list_category(x_trace_id=x_trace_id, limit=limit, page=page)

List all categories.

List all categories.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.category_array import CategoryArray
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.CategoriesApi(api_client)
    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:
        # List all categories.
        api_response = api_instance.list_category(x_trace_id=x_trace_id, limit=limit, page=page)
        print("The response of CategoriesApi->list_category:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoriesApi->list_category: %s\n" % e)

Parameters

Name Type Description Notes
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

CategoryArray

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 categories. -
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]

list_transaction_by_category

TransactionArray list_transaction_by_category(id, x_trace_id=x_trace_id, limit=limit, page=page, start=start, end=end, type=type)

List all transactions in a category.

List all transactions in a category, optionally limited to the date ranges specified.

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.models.transaction_type_filter import TransactionTypeFilter
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.CategoriesApi(api_client)
    id = '123' # str | The ID of the category.
    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)
    start = 'Mon Sep 17 00:00:00 UTC 2018' # date | A date formatted YYYY-MM-DD, to limit the result list.  (optional)
    end = 'Mon Dec 31 00:00:00 UTC 2018' # date | A date formatted YYYY-MM-DD, to limit the result list.  (optional)
    type = firefly_iii_client.TransactionTypeFilter() # TransactionTypeFilter | Optional filter on the transaction type(s) returned (optional)

    try:
        # List all transactions in a category.
        api_response = api_instance.list_transaction_by_category(id, x_trace_id=x_trace_id, limit=limit, page=page, start=start, end=end, type=type)
        print("The response of CategoriesApi->list_transaction_by_category:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoriesApi->list_transaction_by_category: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the category.
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]
start date A date formatted YYYY-MM-DD, to limit the result list. [optional]
end date A date formatted YYYY-MM-DD, to limit the result list. [optional]
type TransactionTypeFilter Optional filter on the transaction type(s) returned [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]

store_category

CategorySingle store_category(category, x_trace_id=x_trace_id)

Store a new category

Creates a new category. The data required can be submitted as a JSON body or as a list of parameters.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.category import Category
from firefly_iii_client.models.category_single import CategorySingle
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.CategoriesApi(api_client)
    category = firefly_iii_client.Category() # Category | JSON array or key=value pairs with the necessary category information. See the model for the exact specifications.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)

    try:
        # Store a new category
        api_response = api_instance.store_category(category, x_trace_id=x_trace_id)
        print("The response of CategoriesApi->store_category:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoriesApi->store_category: %s\n" % e)

Parameters

Name Type Description Notes
category Category JSON array or key=value pairs with the necessary category information. See the model for the exact specifications.
x_trace_id str Unique identifier associated with this request. [optional]

Return type

CategorySingle

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/vnd.api+json, application/json

HTTP response details

Status code Description Response headers
200 New category stored, result in response. -
400 Bad request -
401 Unauthenticated -
404 Page not found -
422 Validation error. The body will have the exact details. -
500 Internal exception -

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

update_category

CategorySingle update_category(id, category_update, x_trace_id=x_trace_id)

Update existing category.

Update existing category.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.category_single import CategorySingle
from firefly_iii_client.models.category_update import CategoryUpdate
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.CategoriesApi(api_client)
    id = '123' # str | The ID of the category.
    category_update = firefly_iii_client.CategoryUpdate() # CategoryUpdate | JSON array with updated category information. See the model for the exact specifications.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)

    try:
        # Update existing category.
        api_response = api_instance.update_category(id, category_update, x_trace_id=x_trace_id)
        print("The response of CategoriesApi->update_category:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoriesApi->update_category: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the category.
category_update CategoryUpdate JSON array with updated category information. See the model for the exact specifications.
x_trace_id str Unique identifier associated with this request. [optional]

Return type

CategorySingle

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/vnd.api+json, application/json

HTTP response details

Status code Description Response headers
200 Updated category stored, result in response -
400 Bad request -
401 Unauthenticated -
404 Page not found -
422 Validation error. The body will have the exact details. -
500 Internal exception -

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