Skip to content

Latest commit

 

History

History
116 lines (81 loc) · 3.56 KB

BudgetsApi.md

File metadata and controls

116 lines (81 loc) · 3.56 KB

ynab.BudgetsApi

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

Method HTTP request Description
get_budget_by_id GET /budgets/{budget_id} Single budget
get_budgets GET /budgets List budgets

get_budget_by_id

BudgetDetailResponse get_budget_by_id(budget_id, last_knowledge_of_server=last_knowledge_of_server)

Single budget

Returns a single budget with all related entities. This resource is effectively a full budget export.

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.BudgetsApi(ynab.ApiClient(configuration))
budget_id = 'budget_id_example' # str | The ID of the Budget.
last_knowledge_of_server = 8.14 # float | The starting server knowledge.  If provided, only entities that have changed since last_knowledge_of_server will be included. (optional)

try:
    # Single budget
    api_response = api_instance.get_budget_by_id(budget_id, last_knowledge_of_server=last_knowledge_of_server)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BudgetsApi->get_budget_by_id: %s\n" % e)

Parameters

Name Type Description Notes
budget_id str The ID of the Budget.
last_knowledge_of_server float The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. [optional]

Return type

BudgetDetailResponse

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_budgets

BudgetSummaryResponse get_budgets()

List budgets

Returns budgets list with summary information.

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.BudgetsApi(ynab.ApiClient(configuration))

try:
    # List budgets
    api_response = api_instance.get_budgets()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BudgetsApi->get_budgets: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

BudgetSummaryResponse

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]