Building the API client library requires Maven be installed.
Supported Java version: 8
Make sure to run Maven commands with Java version 8 as well.
To install the API client library to your local Maven repository, simply execute this command from the ynam-sdk project:
mvn install:install-file -Dfile=target/ynab-sdk-0.0.1.jar -DgroupId=ynab.sdk -DartifactId=ynam-sdk -Dversion=0.0.1 -Dpackaging=jaror
mvn install:install-file -Dfile=target/ynab-sdk-0.0.1.jar -DpomFile=pom.xmlTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn deployRefer to the official documentation for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>ynab.sdk</groupId>
<artifactId>ynab-sdk</artifactId>
<version>0.0.1</version>
<scope>compile</scope>
</dependency>Add this dependency to your project's build file:
compile "ynab.sdk:ynab-sdk:0.0.1"At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
- target/ynab-sdk-0.0.1.jar
- target/lib/*.jar
Please follow the installation instructions. Here is an example of how to use ynab-sdk in your project.
import ynab.client.invoker.*;
import ynab.client.invoker.auth.*;
import ynab.client.model.*;
import ynab.client.api.BudgetsApi;
import java.io.File;
import java.util.*;
public class BudgetsApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: bearer
ApiKeyAuth bearer = (ApiKeyAuth) defaultClient.getAuthentication("bearer");
bearer.setApiKey("YOUR API KEY");
bearer.setApiKeyPrefix("Bearer");
BudgetsApi budgetsApi = new BudgetsApi();
try {
BudgetSummaryResponse budgetSummaryResponse = budgetsApi.getBudgets();
System.out.println(budgetSummaryResponse);
} catch (ApiException e) {
System.err.println("Exception when calling BudgetsApi#getGetBudgets");
e.printStackTrace();
}
}
}All URIs are relative to https://api.youneedabudget.com/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AccountsApi | getAccountById | GET /budgets/{budget_id}/accounts/{account_id} | Single account |
| AccountsApi | getAccounts | GET /budgets/{budget_id}/accounts | Account list |
| BudgetsApi | getBudgetById | GET /budgets/{budget_id} | Single budget |
| BudgetsApi | getBudgets | GET /budgets | List budgets |
| CategoriesApi | getCategories | GET /budgets/{budget_id}/categories | List categories |
| CategoriesApi | getCategoryById | GET /budgets/{budget_id}/categories/{category_id} | Single category |
| MonthsApi | getBudgetMonth | GET /budgets/{budget_id}/months/{month} | Single budget month |
| MonthsApi | getBudgetMonths | GET /budgets/{budget_id}/months | List budget months |
| PayeeLocationsApi | getPayeeLocationById | GET /budgets/{budget_id}/payee_locations/{payee_location_id} | Single payee location |
| PayeeLocationsApi | getPayeeLocations | GET /budgets/{budget_id}/payee_locations | List payee locations |
| PayeeLocationsApi | getPayeeLocationsByPayee | GET /budgets/{budget_id}/payees/{payee_id}/payee_locations | List locations for a payee |
| PayeesApi | getPayeeById | GET /budgets/{budget_id}/payees/{payee_id} | Single payee |
| PayeesApi | getPayees | GET /budgets/{budget_id}/payees | List payees |
| ScheduledTransactionsApi | getScheduledTransactionById | GET /budgets/{budget_id}/scheduled_transactions/{scheduled_transaction_id} | Single scheduled transaction |
| ScheduledTransactionsApi | getScheduledTransactions | GET /budgets/{budget_id}/scheduled_transactions | List scheduled transactions |
| TransactionsApi | bulkCreateTransactions | POST /budgets/{budget_id}/transactions/bulk | Bulk create transactions |
| TransactionsApi | createTransaction | POST /budgets/{budget_id}/transactions | Create new transaction |
| TransactionsApi | getTransactions | GET /budgets/{budget_id}/transactions | List transactions |
| TransactionsApi | getTransactionsByAccount | GET /budgets/{budget_id}/accounts/{account_id}/transactions | List account transactions |
| TransactionsApi | getTransactionsByCategory | GET /budgets/{budget_id}/categories/{category_id}/transactions | List category transactions |
| TransactionsApi | getTransactionsById | GET /budgets/{budget_id}/transactions/{transaction_id} | Single transaction |
| TransactionsApi | getTransactionsByPayee | GET /budgets/{budget_id}/payees/{payee_id}/transactions | List payee transactions |
| TransactionsApi | updateTransaction | PUT /budgets/{budget_id}/transactions/{transaction_id} | Updates an existing transaction |
| UserApi | getUser | GET /user | User info |
- Account
- AccountResponse
- AccountWrapper
- AccountsResponse
- AccountsWrapper
- BudgetDetailResponse
- BudgetDetailWrapper
- BudgetSummary
- BudgetSummaryResponse
- BudgetSummaryWrapper
- BulkIdWrapper
- BulkIds
- BulkResponse
- BulkTransactions
- CategoriesResponse
- Category
- CategoryGroup
- CategoryGroupsWrapper
- CategoryResponse
- CategoryWrapper
- CurrencyFormat
- DateFormat
- ErrorDetail
- ErrorResponse
- HybridTransactionsResponse
- HybridTransactionsWrapper
- MonthDetailResponse
- MonthDetailWrapper
- MonthSummariesResponse
- MonthSummariesWrapper
- MonthSummary
- Payee
- PayeeLocation
- PayeeLocationResponse
- PayeeLocationWrapper
- PayeeLocationsResponse
- PayeeLocationsWrapper
- PayeeResponse
- PayeeWrapper
- PayeesResponse
- PayeesWrapper
- SaveTransaction
- SaveTransactionWrapper
- ScheduledSubTransaction
- ScheduledTransactionResponse
- ScheduledTransactionSummary
- ScheduledTransactionWrapper
- ScheduledTransactionsResponse
- ScheduledTransactionsWrapper
- SubTransaction
- TransactionResponse
- TransactionSummary
- TransactionWrapper
- TransactionsResponse
- TransactionsWrapper
- User
- UserResponse
- UserWrapper
- BudgetDetail
- CategoryGroupWithCategories
- HybridTransaction
- MonthDetail
- ScheduledTransactionDetail
- TransactionDetail
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.
Error:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Fix:
Run the JVM with -XX:MaxHeapSize=512m (or any big number as you need) (or -Xmx512m for short)
Windows 10 specific fix:
Go to Start -> Control Panel -> System -> Advanced(tab) -> Environment Variables -> System
Variables -> New: Variable
name: _JAVA_OPTIONS
Variable value: -Xmx512M