A ruby API client for toggl's V9 API and V3 Reports API.
Install the gem and add to the application's Gemfile by executing:
$ bundle add toggl_rb
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install toggl_rb
To use the Toggl API you need an API token, this can be found on the profile settings page.
You can then setup the token for all instances of TogglRb's connections to the API:
# Assuming API token is stored in an environmental variable, this will setup an API token for all TogglRb connections
TogglRb.config.api_token = ENV.fetch("TOGGL_API_TOKEN", "")
# Alternatively, if you need more granular control you can set up a connection and endpoints with a token:
core_connection = TogglRb::Connection.core_connection
core_connection.api_token = ENV.fetch("TOGGL_API_TOKEN_TWO", "")
projects_endpoint = TogglRb::Core::Projects.new(core_connection)
# projects_endpoint requests will use TOGGL_API_TOKEN_TWO rather than TOGGL_API_TOKEN setup globally
Currently TogglRb only supports a select subset of endpoints:
On The Reporting Endpoints
Group | Endpoint | Status |
---|---|---|
Detailed | POST Search time entries | ✔️ |
Detailed | POST Export detailed report | 🔲 |
Detailed | POST Export detailed report | 🔲 |
Detailed | POST Load totals detailed report | 🔲 |
Summary | POST List project users | 🔲 |
Summary | POST Load project summary | 🔲 |
Summary | POST Search time entries | ✔️ |
Summary | POST Export summary report | 🔲 |
Summary | POST Export summary report | 🔲 |
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/mcordell/toggl_rb.