Skip to content

Latest commit

 

History

History
453 lines (319 loc) · 15.4 KB

UsersApi.md

File metadata and controls

453 lines (319 loc) · 15.4 KB

firefly_iii_client.UsersApi

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

Method HTTP request Description
delete_user DELETE /v1/users/{id} Delete a user.
get_user GET /v1/users/{id} Get a single user.
list_user GET /v1/users List all users.
store_user POST /v1/users Store a new user
update_user PUT /v1/users/{id} Update an existing user's information.

delete_user

delete_user(id, x_trace_id=x_trace_id)

Delete a user.

Delete a user. You cannot delete the user you're authenticated with. This cannot be undone. Be careful!

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.UsersApi(api_client)
    id = '123' # str | The user ID.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)

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

Parameters

Name Type Description Notes
id str The user ID.
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 User 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_user

UserSingle get_user(id, x_trace_id=x_trace_id)

Get a single user.

Gets all info of a single user.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.user_single import UserSingle
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.UsersApi(api_client)
    id = '123' # str | The user ID.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)

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

Parameters

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

Return type

UserSingle

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 user. -
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_user

UserArray list_user(x_trace_id=x_trace_id, limit=limit, page=page)

List all users.

List all the users in this instance of Firefly III.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.user_array import UserArray
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.UsersApi(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 users.
        api_response = api_instance.list_user(x_trace_id=x_trace_id, limit=limit, page=page)
        print("The response of UsersApi->list_user:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->list_user: %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

UserArray

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 users. -
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_user

UserSingle store_user(user, x_trace_id=x_trace_id)

Store a new user

Creates a new user. The data required can be submitted as a JSON body or as a list of parameters. The user will be given a random password, which they can reset using the "forgot password" function.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.user import User
from firefly_iii_client.models.user_single import UserSingle
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.UsersApi(api_client)
    user = firefly_iii_client.User() # User | JSON array or key=value pairs with the necessary user 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 user
        api_response = api_instance.store_user(user, x_trace_id=x_trace_id)
        print("The response of UsersApi->store_user:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->store_user: %s\n" % e)

Parameters

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

Return type

UserSingle

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 user 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_user

UserSingle update_user(id, user, x_trace_id=x_trace_id)

Update an existing user's information.

Update existing user.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.user import User
from firefly_iii_client.models.user_single import UserSingle
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.UsersApi(api_client)
    id = '123' # str | The user ID.
    user = firefly_iii_client.User() # User | JSON array with updated user 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 an existing user's information.
        api_response = api_instance.update_user(id, user, x_trace_id=x_trace_id)
        print("The response of UsersApi->update_user:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->update_user: %s\n" % e)

Parameters

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

Return type

UserSingle

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