• Stars
    star
    472
  • Rank 93,034 (Top 2 %)
  • Language
  • Created about 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

API documentation for Basecamp 4

The Basecamp 4 API

Welcome to the Basecamp 4 API! If you're looking to integrate your application with Basecamp 4 or create your own application in concert with data inside of Basecamp 4, you're in the right place. We're happy to have you!

Compatibility with previous Basecamp APIs

The Basecamp 4 API is not compatible with the Basecamp Classic API or the Basecamp 2 API. All integrations will start fresh with the new API. The core ingredients are the same, though: Basecamp 4 is a REST-style API that uses JSON for serialization and OAuth 2.0 for authentication.

What's different?

If you've used a previous version of the Basecamp API, you need to adapt your integration code. Here are some notable changes for the Basecamp 4 API:

  • We require OAuth 2.0 for authenticationβ€”no more Basic authentication
  • Pagination is performed via the Link and X-Total-Count headers

Making a request

All URLs start with https://3.basecampapi.com/999999999/. URLs are HTTPS only. The path is prefixed with the account ID, but no /api/v1 API prefix. Also, note the different domain!

To make a request for all the projects on your account, append the projects index path to the base URL to form something like https://3.basecampapi.com/999999999/projects.json. In cURL, it looks like this:

curl -H "Authorization: Bearer $ACCESS_TOKEN" -A 'MyApp ([email protected])' https://3.basecampapi.com/999999999/projects.json

To create something, it's the same idea, but you also have to include the Content-Type header and the JSON data:

curl -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -A 'User-Agent: MyApp ([email protected])' \
  -d '{ "name": "My new project!" }' \
  https://3.basecampapi.com/999999999/projects.json

Throughout the Basecamp 4 API docs, we include "Copy as cURL" examples. To try the examples in your shell, copy your OAuth 2.0 access token into your clipboard and run:

export ACCESS_TOKEN=PASTE_ACCESS_TOKEN_HERE
export ACCOUNT_ID=999999999

Then you should be able to copy/paste any example from the docs. After pasting a cURL example, you can pipe it to a JSON pretty printer to make it more readable. Try jsonpp or json_pp on OSX:

curl -s -H "Authorization: Bearer $ACCESS_TOKEN" https://3.basecampapi.com/999999999/projects.json | json_pp

Authentication

As mentioned above, to authenticate you must use OAuth 2.0. OAuth 2.0 allows users to authorize your application to use Basecamp on their behalf without having to copy/paste API tokens or touch sensitive login information.

Read the authentication guide to get started.

Identifying your application

You must include a User-Agent header with both:

  • The name of your application
  • A link to your application or your email address

We use this information to get in touch if you're doing something wrong (so we can warn you before you're blacklisted) or something awesome (so we can congratulate you). Here are examples of acceptable User-Agent headers:

  • User-Agent: Freshbooks (http://freshbooks.com/contact.php)
  • User-Agent: Fabian's Ingenious Integration ([email protected])

If you don't include a User-Agent header, you'll get a 400 Bad Request response.

JSON only

We use JSON for all API data. The style is no root element and snake_case for object keys. This means that you have to send the Content-Type header Content-Type: application/json; charset=utf-8 when you're POSTing or PUTing data into Basecamp. All API URLs end in .json to indicate that they return JSON. Alternatively you can send Accept: application/json.

You'll receive a 415 Unsupported Media Type response code if you don't include the Content-Type header.

Pagination

Most collection APIs paginate their results. The number of requests that'll appear on each page is variable. In most cases, we use a geared pagination ratio with 15 results on page 1, 30 on page 2, 50 on 3, and then 100 on 4 and above. The Basecamp 4 API follows the RFC5988 convention of using the Link header to provide URLs for the next page. Follow this convention to retrieve the next page of dataβ€”please don't build the pagination URLs yourself!

Here's an example response header from requesting the third page of messages:

Link: <https://3.basecampapi.com/999999999/buckets/2085958496/messages.json?page=4>; rel="next"

If the Link header is blank, that's the last page. The Basecamp 4 API also provides the X-Total-Count header, which displays the total number of resources in the collection you are fetching.

Using HTTP caching

You must use HTTP freshness headers to speed up your application and lighten the load on our servers. Most API responses will include an ETag or Last-Modified header. When you first request a resource, store these values. On subsequent requests, submit them back to us as If-None-Match and If-Modified-Since, respectively. If the resource hasn't changed since your last request, you'll get a 304 Not Modified response with no body, saving you the time and bandwidth of sending something you already have.

Handling errors

API clients must expect and gracefully handle transient server errors and rate limits. We recommend baking graceful 5xx and 429 retries into your integration from the beginning so errors are handled automatically.

Rate limiting (429 Too Many Requests)

We return a 429 Too Many Requests response when you've exceeded a rate limit. Consult the Retry-After response header to determine how long to wait (in seconds) before retrying the request.

Plan ahead to gracefully handle the failure modes that API backpressure will exert on your integration. Multiple rate limits are in effect, e.g. for GET vs POST requests and per-second/hour/day limits, and they're adjusted dynamically, so responding to them dynamically is essential, particularly at high traffic levels.

For a sense of scale, the first rate limit you'll commonly encounter is currently 50 requests per 10 second period per IP address.

5xx server errors

If Basecamp is having trouble, you will get a response with a 5xx status code indicating a server error. 500 (Internal Server Error), 502 (Bad Gateway), 503 (Service Unavailable), and 504 (Gateway Timeout) may be retried with exponential backoff.

404 Not Found

API requests may 404 due to deleted content, an inactive account, missing user permissions, etc. Detect these conditions to give your users a clear explanation about why they can't connect to Basecamp. Do not automatically retry these requests.

  • Inactive account. 404 Not Found response with a Reason: Account Inactive header. Due to an expired trial or account suspension. All API requests to an inactive account will fail, so we recommend detecting and disabling the account in your integration as well.
  • Inaccessible items. 404 Not Found response. Due to a deleted item or insufficient permissions.

Rich text content

Many resources, including messages, documents, and comments, represent their content as rich text in HTML. Rich text content may contain lists, block quotes, simple formatting, and inline attachments such as mentions, images, and files.

See the Rich text section for more information about working with HTML and attachments in rich text content.

API endpoints

Listing your application

To add your application to our public list of Basecamp 4 integrations, go to https://github.com/basecamp/bc3-integrations and open a pull request.

Getting Help

If you have a question about the API, please open a support ticket.

Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in discussions about the Basecamp 4 API, you agree to abide by these terms.

License

These API docs are licensed under Creative Commons (CC BY-SA 4.0). Please share, remix, and distribute as you see fit.

More Repositories

1

trix

A rich text editor for everyday writing
JavaScript
17,847
star
2

kamal

Deploy web apps anywhere.
Ruby
9,584
star
3

handbook

Basecamp Employee Handbook
6,165
star
4

omakub

Opinionated Ubuntu Setup
Shell
4,152
star
5

pow

Zero-configuration Rack server for Mac OS X
CoffeeScript
3,423
star
6

policies

37signals policies, terms, and legal. Share them; reuse them; contribute to them.
1,863
star
7

local_time

Rails engine for cache-friendly, client-side local time
CoffeeScript
1,791
star
8

marginalia

Attach comments to ActiveRecord's SQL queries
Ruby
1,676
star
9

mail_view

Visual email testing
Ruby
1,341
star
10

xip-pdns

PowerDNS pipe backend adapter powering xip.io
Shell
1,159
star
11

geared_pagination

Paginate Active Record sets at variable speeds
Ruby
758
star
12

wysihat

A WYSIWYG JavaScript framework
JavaScript
681
star
13

bcx-api

API documentation and wrappers for Basecamp 2
672
star
14

name_of_person

Presenting names of people in full, familiar, abbreviated, and initialized forms (but without titulation etc)
Ruby
647
star
15

console1984

The Rails console you love, 1984 style
Ruby
609
star
16

google_sign_in

Sign in (or up) with Google for Rails applications
Ruby
494
star
17

intermission

intermission helps you perform zero down time application maintenance
Lua
364
star
18

audits1984

Auditing tool for Rails console sessions
Ruby
336
star
19

snapback_cache

A client side page cache for jquery.
JavaScript
316
star
20

full_request_logger

Make full request logs accessible via web UI
Ruby
305
star
21

mysql_role_swap

(Nearly) Zero interruption mysql maintenance script.
Ruby
282
star
22

concerning

Bite-sized separation of concerns
Ruby
201
star
23

api

API integration and more for Basecamp products (Basecamp, Highrise, Campfire, Backpack)
192
star
24

easymon

Easy Monitoring
Ruby
191
star
25

trashed

Tell StatsD about request time, GC, objects and more. Latest Rails 4 and Ruby 2.1 support, and ancient Rails 2 and Ruby 1.8 support.
Ruby
189
star
26

highrise-api

Official API documentation for Highrise
130
star
27

fast_remote_cache

A faster version of Capistrano's remote_cache deployment strategy
Ruby
125
star
28

mass_encryption

Ruby
106
star
29

platform_agent

Parse user agent to deduce the platform
Ruby
103
star
30

cached_externals

Symlink to external dependencies, rather than bloating your repositories with them
Ruby
100
star
31

homographic_spoofing

Toolkit to both detect and sanitize homographic spoofing attacks in URLs and Email addresses
Ruby
98
star
32

campfire-api

Official API documentation for Campfire
97
star
33

basecamp-classic-api

Official API documentation for Basecamp Classic
87
star
34

lufo

Tracks the most recent options chosen on a `<select>` element and displays them at the top of the list
JavaScript
87
star
35

powprox

Pow .dev sites, meet SSL and HTTP/2
Shell
83
star
36

libmemcached_store

ActiveSupport::Cache wrapper for libmemcached
Ruby
81
star
37

action_profiler

Profile Rails requests on a live app
Ruby
75
star
38

bc3-integrations

Ruby
73
star
39

project_search

Rails plugin that adds a script/find command for searching your project
Ruby
71
star
40

activestorage-office-previewer

Active Storage previewer for Microsoft Office files based on LibreOffice
Ruby
67
star
41

turbo-8-morphing-demo

Ruby
58
star
42

dumpsterfire-2020

Code that runs the dumpster
HTML
47
star
43

cognition

Match text; run commands. Works great for building a chatbot!
Ruby
37
star
44

snapshot

A rails plugin that provides tasks for creating and restoring snapshots of development data.
Ruby
34
star
45

backpack-api

Official API documentation for Backpack
Ruby
20
star
46

ruby-dev

Old Rubies on new Macs
15
star
47

orc

Orc(hestrator) - A really bad pow.cx clone for linux
Shell
10
star
48

cleversafe

Ruby
7
star
49

accessibility

Guidelines and tools we use at 37signals to make sure our apps are accessible
7
star
50

memcached_bench

Ruby
6
star
51

duo-api

Ruby Gem for communicating with the Duo Api
Ruby
6
star
52

Xamarin.iOS.OnePasswordExtension

1Password bindings for Xamarin.iOS
C#
5
star
53

mail

Ruby
4
star
54

composed_of_ipaddr

Compact IPv4 attributes for Active Record. Presents an unsigned int (4 bytes) as an IPAddr.
Ruby
4
star
55

house-style

37signals house style
Ruby
3
star
56

deep_hash_transform

Re-key a nested Hash to all-Symbol or -String keys. Rails 4+ backport.
Ruby
3
star
57

assets-redirect

Ruby
2
star
58

github-issues

Github Issue query CLI
Go
2
star
59

homebrew-dev

Old software to build old stuff on new Macs
Ruby
1
star
60

nsone

A stupid simple API client for NS1
Ruby
1
star