A Ruby interface to the Harvest API.
gem 'harvest'
gem install harvest
harvest = Harvest::Connection.new do |config|
config.access_token = "YOUR_ACCESS_TOKEN"
config.account_id = "YOUR_ACCOUNT_ID"
end
After configuring the harvest connection, you can do the following things.
Full parameter documnetation can be found at
- https://help.getharvest.com/api-v2/users-api/users/users/
- https://help.getharvest.com/api-v2/users-api/users/project-assignments/
harvest.user
Options
options = {
is_active: true, # boolean
updated_since: Date.today.prev_month, # datetime
page: 1, # integer
per_page: 5 # integer
}
harvest.users(options)
harvest.user(user.id)
Options
options = {
first_name: "Test", # REQUIRED - string
last_name: "User", # REQUIRED - string
email: "test.user@your-domain", # REQUIRED - string
}
harvest.user_create(options)
Options
options = {
last_name: "User-Updated" # string
}
harvest.user_create(user.id, options)
harvest.user_delete(user.id)
harvest.user_project_assignments
Options
options = {
page: 1, # integer
per_page: 5 # integer
}
harvest.user_project_assignments(user.id, options)
Full parameter documentation can be found at
- https://help.getharvest.com/api-v2/clients-api/clients/clients/
- https://help.getharvest.com/api-v2/clients-api/clients/contacts/
Options
options = {
is_active: true, # boolean
updated_since: Date.today.prev_month, # datetime
page: 1, # integer
per_page: 5 # integer
}
harvest.clients(options)
harvest.client(client.id)
Options
options = {
name: "Test Client", # REQUIRED - string
}
harvest.client_create(options)
Options
options = {
name: "Test Client Updated" # string
}
harvest.client_update(client.id, options)
harvest.client_delete(client.id)
Full parameter documentation can be found at
Options
options = {
is_active: true, # boolean
updated_since: Date.today.prev_month, # datetime
page: 1, # integer
per_page: 5 # integer
}
harvest.contacts(options)
harvest.contact(contact.id)
Options
options = {
client_id: client.id, # REQUIRED - integer
first_name: "Test", # REQUIRED - string
}
harvest.contact_create(options)
Options
options = {
first_name: "Test Updated" # string
}
harvest.contact_update(contact.id, options)
harvest.contact_delete(contact.id)
- invoices
- estimates
- expenses
- tasks
- timesheets
- projects
- roles
- all the things
- clean up api/request
- add tests
- model relations
- set attribute data types
Bug reports and pull requests are welcome on GitHub at https://github.com/phiction/harvest.
The gem is available as open source under the terms of the MIT License.