Project

camp3

0.01
No release in over 3 years
Low commit activity in last 3 years
Ruby client for Basecamp 3 API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0
~> 3.9

Runtime

~> 0.18
 Project Readme

camper CI Gem Version

Camper is a Ruby wrapper for the Basecamp 3 API.

You can check out the gem documentation at https://www.rubydoc.org/gems/camper

Installation

Add this line to your application's Gemfile:

gem 'camper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install camper

Status of API endpoints

The up-to-date list of Basecamp API endpoints can be found at here.

Currently, Camper supports the following endpoints:

Usage

Configuration

Getting a client and configuring it:

require 'camper'

client = Camper.client

client.configure do |config|
  config.client_id = 'client_id'
  config.client_secret = 'client_secret'
  config.account_number = 'account_number'
  config.refresh_token = 'refresh_token'
  config.access_token = 'access_token'
end

Alternatively, it is possible to invoke the top-level #configure method to get a client:

require 'camper'

client = Camper.configure do |config|
  config.client_id = 'client_id'
  config.client_secret = 'client_secret'
  config.account_number = 'account_number'
  config.refresh_token = 'refresh_token'
  config.access_token = 'access_token'
end

Also, the client can read directly the following environment variables:

  • BASECAMP_CLIENT_ID
  • BASECAMP_CLIENT_SECRET
  • BASECAMP_ACCOUNT_NUMBER
  • BASECAMP_REFRESH_TOKEN
  • BASECAMP_ACCESS_TOKEN

then the code would look like:

require 'camper'

client = Camper.client

Examples

Example getting list of TODOs:

require 'camper'

client = Camper.configure do |config|
  config.client_id = ENV['BASECAMP_CLIENT_ID']
  config.client_secret = ENV['BASECAMP_CLIENT_SECRET']
  config.account_number = ENV['BASECAMP_ACCOUNT_NUMBER']
  config.refresh_token = ENV['BASECAMP_REFRESH_TOKEN']
  config.access_token = ENV['BASECAMP_ACCESS_TOKEN']
end

# gets a paginated response
projects = client.projects

# iterate all projects
projects.auto_paginate do |p|
  puts "Project: #{p.inspect}"

  puts "Todo set: #{p.todoset.inspect}"

  todoset = client.todoset(p)

  # iterate over the first 5 todo lists
  client.todolists(todoset).auto_paginate(5) do |list|
    puts "Todolist: #{list.title}"

    client.todos(list).auto_paginate do |todo|
      puts todo.inspect
    end
  end
end

For more examples, check out the examples folder

Contributing

Check out the Contributing page.

Changelog

For inspecting the changes and tag releases, check the Changelog page

Appreciation

The gem code structure and documentation is based on the awesome NARKOZ/gitlab gem

License

Checkout the LICENSE for details