All URIs are relative to https://api.youneedabudget.com/v1
Method | HTTP request | Description |
---|---|---|
getAccountById | GET /budgets/{budget_id}/accounts/{account_id} | Single account |
getAccounts | GET /budgets/{budget_id}/accounts | Account list |
AccountResponse getAccountById(budgetId, accountId)
Single account
Returns a single account
// Import classes:
//import ynab.client.invoker.ApiClient;
//import ynab.client.invoker.ApiException;
//import ynab.client.invoker.Configuration;
//import ynab.client.invoker.auth.*;
//import ynab.client.api.AccountsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: bearer
ApiKeyAuth bearer = (ApiKeyAuth) defaultClient.getAuthentication("bearer");
bearer.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.setApiKeyPrefix("Token");
AccountsApi apiInstance = new AccountsApi();
UUID budgetId = new UUID(); // UUID | The ID of the Budget.
UUID accountId = new UUID(); // UUID | The ID of the Account.
try {
AccountResponse result = apiInstance.getAccountById(budgetId, accountId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountsApi#getAccountById");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
budgetId | UUID | The ID of the Budget. | |
accountId | UUID | The ID of the Account. |
- Content-Type: Not defined
- Accept: application/json
AccountsResponse getAccounts(budgetId)
Account list
Returns all accounts
// Import classes:
//import ynab.client.invoker.ApiClient;
//import ynab.client.invoker.ApiException;
//import ynab.client.invoker.Configuration;
//import ynab.client.invoker.auth.*;
//import ynab.client.api.AccountsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: bearer
ApiKeyAuth bearer = (ApiKeyAuth) defaultClient.getAuthentication("bearer");
bearer.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.setApiKeyPrefix("Token");
AccountsApi apiInstance = new AccountsApi();
UUID budgetId = new UUID(); // UUID | The ID of the Budget.
try {
AccountsResponse result = apiInstance.getAccounts(budgetId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountsApi#getAccounts");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
budgetId | UUID | The ID of the Budget. |
- Content-Type: Not defined
- Accept: application/json