All URIs are relative to https://api.youneedabudget.com/v1
Method | HTTP request | Description |
---|---|---|
getCategories | GET /budgets/{budget_id}/categories | List categories |
getCategoryById | GET /budgets/{budget_id}/categories/{category_id} | Single category |
CategoriesResponse getCategories(budgetId)
List categories
Returns all categories grouped by category group.
// 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.CategoriesApi;
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");
CategoriesApi apiInstance = new CategoriesApi();
UUID budgetId = new UUID(); // UUID | The ID of the Budget.
try {
CategoriesResponse result = apiInstance.getCategories(budgetId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CategoriesApi#getCategories");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
budgetId | UUID | The ID of the Budget. |
- Content-Type: Not defined
- Accept: application/json
CategoryResponse getCategoryById(budgetId, categoryId)
Single category
Returns a single category
// 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.CategoriesApi;
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");
CategoriesApi apiInstance = new CategoriesApi();
UUID budgetId = new UUID(); // UUID | The ID of the Budget.
UUID categoryId = new UUID(); // UUID | The ID of the Category.
try {
CategoryResponse result = apiInstance.getCategoryById(budgetId, categoryId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CategoriesApi#getCategoryById");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
budgetId | UUID | The ID of the Budget. | |
categoryId | UUID | The ID of the Category. |
- Content-Type: Not defined
- Accept: application/json