Skip to content

Phiction/harvest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Harvest Ruby Gem

A Ruby interface to the Harvest API.

Installation

Gemfile

gem 'harvest'

Standalone

gem install harvest

Configuration

harvest = Harvest::Connection.new do |config|
  config.access_token = "YOUR_ACCESS_TOKEN"
  config.account_id   = "YOUR_ACCOUNT_ID"
end

Usage

After configuring the harvest connection, you can do the following things.

Users

Full parameter documnetation can be found at

Current

harvest.user

List

Options

options = {
  is_active: true, # boolean
  updated_since: Date.today.prev_month, # datetime
  page: 1, # integer
  per_page: 5 # integer
}


harvest.users(options)

Find

harvest.user(user.id)

Create

Options

options = {
  first_name: "Test", # REQUIRED - string
  last_name: "User", # REQUIRED - string
  email: "test.user@your-domain", # REQUIRED - string
}


harvest.user_create(options)

Update

Options

options = {
  last_name: "User-Updated" # string
}


harvest.user_create(user.id, options)

Delete

harvest.user_delete(user.id)

Current Project Assignments

harvest.user_project_assignments

Project Assignments

Options

options = {
  page: 1, # integer
  per_page: 5 # integer
}


harvest.user_project_assignments(user.id, options)

Clients

Full parameter documentation can be found at

List

Options

options = {
  is_active: true, # boolean
  updated_since: Date.today.prev_month, # datetime
  page: 1, # integer
  per_page: 5 # integer
}


harvest.clients(options)

Find

harvest.client(client.id)

Create

Options

options = {
  name: "Test Client", # REQUIRED - string
}


harvest.client_create(options)

Update

Options

options = {
  name: "Test Client Updated" # string
}


harvest.client_update(client.id, options)

Delete

harvest.client_delete(client.id)

Contacts

Full parameter documentation can be found at

List

Options

options = {
  is_active: true, # boolean
  updated_since: Date.today.prev_month, # datetime
  page: 1, # integer
  per_page: 5 # integer
}


harvest.contacts(options)

Find

harvest.contact(contact.id)

Create

Options

options = {
  client_id: client.id, # REQUIRED - integer
  first_name: "Test",	# REQUIRED - string
}


harvest.contact_create(options)

Update

Options

options = {
  first_name: "Test Updated" # string
}


harvest.contact_update(contact.id, options)

Delete

harvest.contact_delete(contact.id)

TODOs

models

  • invoices
  • estimates
  • expenses
  • tasks
  • timesheets
  • projects
  • roles

misc

  • all the things
  • clean up api/request
  • add tests
  • model relations
  • set attribute data types

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/phiction/harvest.

License

The gem is available as open source under the terms of the MIT License.

About

A Ruby interface to the Harvest API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published