Skip to content

Latest commit

 

History

History
120 lines (84 loc) · 3.37 KB

AccountsApi.md

File metadata and controls

120 lines (84 loc) · 3.37 KB

ynab.AccountsApi

All URIs are relative to https://api.youneedabudget.com/v1

Method HTTP request Description
get_account_by_id GET /budgets/{budget_id}/accounts/{account_id} Single account
get_accounts GET /budgets/{budget_id}/accounts Account list

get_account_by_id

AccountResponse get_account_by_id(budget_id, account_id)

Single account

Returns a single account

Example

from __future__ import print_function
import time
import ynab
from ynab.rest import ApiException
from pprint import pprint

# Configure API key authorization: bearer
configuration = ynab.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = ynab.AccountsApi(ynab.ApiClient(configuration))
budget_id = 'budget_id_example' # str | The ID of the Budget.
account_id = 'account_id_example' # str | The ID of the Account.

try:
    # Single account
    api_response = api_instance.get_account_by_id(budget_id, account_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountsApi->get_account_by_id: %s\n" % e)

Parameters

Name Type Description Notes
budget_id str The ID of the Budget.
account_id str The ID of the Account.

Return type

AccountResponse

Authorization

bearer

HTTP request headers

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

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

get_accounts

AccountsResponse get_accounts(budget_id)

Account list

Returns all accounts

Example

from __future__ import print_function
import time
import ynab
from ynab.rest import ApiException
from pprint import pprint

# Configure API key authorization: bearer
configuration = ynab.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = ynab.AccountsApi(ynab.ApiClient(configuration))
budget_id = 'budget_id_example' # str | The ID of the Budget.

try:
    # Account list
    api_response = api_instance.get_accounts(budget_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountsApi->get_accounts: %s\n" % e)

Parameters

Name Type Description Notes
budget_id str The ID of the Budget.

Return type

AccountsResponse

Authorization

bearer

HTTP request headers

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

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