HarvestClient is an easy to use wrapper for the Harvest API.
It can currently only be used to fetch data from Harvest, but will eventually support creating and updating data as well.
Example that fetches all users:
HarvestClientFactory factory = new HarvestClientFactory();
HarvestClient client = factory.create("subdomain", "username", "password");
UserCollection users = client.getUsers();
for (User user : users)
{
// Do something
}
subdomain
is the subdomain of your harvest account (e.g. https://subdomain.harvestapp.com
Gets all users.
Gets all users updated since updatedSince
.
Gets a user by id.
Gets all clients.
Gets all clients updated since updatedSince
.
Gets a client by id.
Gets all day entries by a user.
Filters available in params.
Gets all day entries by a project.
Filters available in params.
Gets all projects.
Gets all projects updated since updatedSince
.
Gets all projects for a client
Gets all projects for a client updated since updatedSince
.
Gets a project by id.
Gets all tasks.
Gets all tasks updated since updatedSince
.
Gets a task by id.
Gets all user assignments for a project.
Gets all user assignments for a project updated since updatedSince
.
Gets all task assignments for a project.
Gets all task assignments for a project updated since updatedSince
.
Gets the 50 most recent invoices.
Pagination and filters available in params.
Gets an invoice by id.
Gets all invoice item categories.
Gets all invoice messages for an invoice.
Gets an invoice message.
Gets all invoice payments for an invoice.
Gets an invoice payment for an invoice.
Any client method can throw a HarvestClientException.
Will be thrown if a required parameter is missing.
Will be thrown if the Harvest API throttle is reached.
If you encounter this you should consider caching.