Skip to content

alexggordon/basecampeverest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basecamp Everest

This is a ruby gem for the Basecamp API. I've tried to make it as complete and true to the API as possible and everything generally follows the same layout as the API.

A quick note though, hopefully to save some people some frustration, if you see "all" in the method title, then it is not project specific. For example,

Basecampeverest::Project.all 

will return all the projects, and

Basecampeverest::TodoList.all 

will return ALL the Todo Lists for ALL projects. In the same methodology, any method that includes the word "find" is project specific where it applies.

INDEX

Installation

Simply go to your gemfile and add

gem 'basecampeverest'

And then go to the terminal and run

bundle install

and you should be all set!

Alternatively, you can run

gem install basecampeverest

Initializing the Connection

The best way to perform the connection is with the ruby :before_filter command

Class whatever < ApplicationController
before_filter :basecamp_connect
...
...
...
private
	def basecamp_connect
		@authorization = { :username => "first.last@example.com", :password => "IuseSecureP@assw0rd$_" }
		@user_agent = "PutAnythingHere (first.last@example.com)"
		@basecamp_ID = "123456"
		Basecampeverest::Connect.new(@basecamp_ID, @authorization, @user_agent)
	end

Initializing the controller will return.

=> #<Basecampeverest::Connect:0x007abcd123455>

Accesses

This module checks for access to projects. Access API Reference.

There are four methods.

  1. Access for Project

    Basecampeverest::Access.for_project(project_id)

    Returns a hash with the people that have access to the project.

  2. Access for Calendar

    Basecampeverest::Access.for_calendar(calendar_id)

    Returns a hash with the people that have access to a calendar.

  3. Grant Access to Project

    The options hash is a hash with the user ID's and email addresses formatted like so:

    { "ids" => { 5, 6, 10 },
      "email_addresses" => { "someone@example.com", "someoneelse@example.com" } }

    Pass in this hash to the method.

    Basecampeverest::Access.grant_project(project_id, options={})

    Returns a 204 if successful.

  4. Revoke Access to user.

    Pass in the user ID of the user to revoke access to the project. To obtain the user id take a look in the people section.

    Basecampeverest::Access.revoke_project(project_id, options={})

    Returns a 204 if successful.

Attachments

This module is the first of a two step process for file uploads. Attachment API Reference

It has not been implemented yet.

Calendars

This module controls the calendar. Calendar API Reference

There are five methods.

  1. Find all Calendars

    This method returns all calendars for a project.

    Basecampeverest::Calendar.all

    Returns an array of all the calendars

  2. Find a specific Calendar

    This method returns a specific calendar.

    Basecampeverest::Calendar.find(calendar_id)

    Returns information about a specific calendar

  3. Create a Calendar

    This method creates a calendar. The options hash should just contain a :name element.

    Basecampeverest::Calendar.new(options={})

    Returns a 201 with the information of the created calendar.

  4. Update a Calendar

    This method updates a calendar. The options hash should just contain the updated calendar information.

    Basecampeverest::Calendar.new(options={})

    Returns a 200 with the information of the updated calendar.

  5. Delete a Calendar

    This method deletes a calendar.

    Basecampeverest::Calendar.delete(calendar_id)

    Returns a message with the success or failure of the deletion.

Calendar Events

This module controls the calendar events. A quick note, this is not to be confused with events, which is different. Yes they could have been better named, but they weren't. Calendar Events API Reference

There are eleven methods.

  1. Upcoming events for the Project

    This method

    Basecampeverest::

    Returns a

  2. Upcoming events for the Project

    This method

    Basecampeverest::

    Returns a

  3. Upcoming events for the Project

    This method

    Basecampeverest::

    Returns a

  4. Upcoming events for the Project

    This method

    Basecampeverest::

    Returns a

  5. Upcoming events for the Project

    This method

    Basecampeverest::

    Returns a

  6. Upcoming events for the Project

    This method

    Basecampeverest::

    Returns a

  7. Upcoming events for the Project

    This method

    Basecampeverest::

    Returns a

  8. Upcoming events for the Project

    This method

    Basecampeverest::

    Returns a

  9. Upcoming events for the Project

    This method

    Basecampeverest::

    Returns a

  10. Upcoming events for the Project

    This method

    Basecampeverest::

    Returns a

  11. Upcoming events for the Project

    This method

    Basecampeverest::

    Returns a

Comments

Documents

Events

Messages

People

Projects

Basecampeverest::Project.all

=>[{"id"=>494832908, "name"=>"Cool Basecamp Project", "description"=>"this is a description", "archived"=>false, "is_client_project"=>false, 
"created_at"=>"2013-11-06T13:53:17.000-05:00", "updated_at"=>"2013-12-05T13:34:20.000-05:00", "draft"=>false,
"last_event_at"=>"2013-12-05T13:34:20.000-05:00", "starred"=>false,
"url"=>"https://basecamp.com/123456/api/v1/projects/494832908-Cool-Basecamp-Project.json"}]

Todo Items

Todo Lists

Topics

Uploads

License

The MIT License (MIT)

Copyright (c) 2014 Veracross LLC, Alex Gordon

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A ruby gem for accessing the Basecamp API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages