Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time

Basecamp API v3 Integration

This is a Drupal module that facilitates using the [](Basecamp API v3).

As an integration module, this facilitates transactions between the Basecamp endpoints, and requires simple coding to achieve this.

After creating an authorized application & storing the initial access token & refresh token, this module will continue to renew the token via a cron job that runs once per day.

Once complete, actions, such as creating a new todo, are as simple as:

$data = [
  'content' => $title,
  'description' => $message,
  'due_on' => date('Y-m-d', strtotime('+7 days')),
  'notify' => TRUE,
  'assignee_ids' => [1,2,3],
$project = $config->get('project');
$list = $config->get('list');
Basecamp::createTodo($project, $list, $data);

Proper setup & configuration of the refresh token

At this time, creating the initial access & refresh token is the purview of the developer (and it is pretty easy -- see

  1. Sign in to Basecamp with the user ID that will provide the integration (in most cases, this should be identified as a non-human account so that people know that actions performed are being triggered by the Drupal integration).
  2. Go to and use the Authorization dialog to generate a 1-time code.
  3. Trade this code for a long-lived access token & refresh token:
curl -X POST -d "type=web_server&client_id=your-client-id&redirect_uri=your-redirect-uri&client_secret=your-client-secret&code=verification-code"
  1. Set these tokens in Drupal's non-config-exportable State API:
vendor/bin/drush state:set basecamp_api_refresh_token <your token>
vendor/bin/drush state:set basecamp_api_access_token <your token>
  1. Important: by default, this token will not refresh via cron so that development environments don't accidentally invalidate your access token in the production environment. For the token to be refreshed regularly in your production environment, add the following to your settings.php or equivalent:
$settings['basecamp_api_do_refresh'] = TRUE;