10

I've been looking around for a long time how to get files from Basecamp and so far it seems like a 'mission impossible', but I wanted to ask here as well:

Is there any way to get files from Basecamp projects and, if there is one, how?

Thanks in advance.

Edited: I mean how to get the uploaded files. You can export all project data except the files you have uploaded there.

Oliver Maksimovic
  • 3,204
  • 3
  • 28
  • 44
  • Update: I contacted BaseCamp customer service and they were happy to zip all of the files up and stick in a "Customer Service" project which doesn't count towards my storage limit. Not an elegant solution, but it worked. The archive was organized by folders, with each project in a separate folder. – Simon Woodside May 07 '12 at 17:19
  • I have voted for all answers that are most likely to work today. Unfortunately, I don't have time to check each of them since it's been almost 3 years since I posted the question and I'm not in charge for that project any more, but based on votes by other people I assume they are fine. I like the wget+cookie thingie (nice one, really), however I will accept the answer about API because it reflects what is valid today, without nasty hacks/workarounds. – Oliver Maksimovic Apr 21 '13 at 22:33

10 Answers10

12

You can export everything from Basecamp using the following steps.

  1. Log in using Chrome.
  2. Copy Cookie header from a page document request in Chrome Developer tools.
  3. wget --mirror -e robots=no --reject logout --no-cookies 'http://your-subdomain.basecamphq.com' --header <pasted-cookie-header>
Matt McClure
  • 16,009
  • 2
  • 28
  • 30
  • Now that (in 2012) Basecamp became Basecamp Classic and the new Basecamp is different, does this method still work? Does it work if you don't have a subdomain? – LarsH Feb 11 '15 at 16:29
9

Matt McClure's answer was spot on but a couple of things held me up;

  1. To find the required cookie in Chrome Developer tools, click on Network icon on top and then Headers tab.

  2. Copy the entire cookie section from the 'request headers' section, including the 'Cookie:' label

  3. Paste the entire string with quotes where matt indicated <pasted-cookie-header> as follows;

    wget --mirror -e robots=no --reject logout --no-cookies 'http://your-subdomain.basecamphq.com' --header 'Cookie: session_token=c6a1ea88a0187b88025e; transition_token=BAhbB2kDA0VjSXU6CVRpbWUNqB...'

(I've shortened the cookie string for clarity)

mrjimoy_05
  • 3,452
  • 9
  • 58
  • 95
Peter Mee
  • 91
  • 1
  • 1
3

The BaseCamp API purports to offer FULL access including files.

If you have any knowledge of REST you will be able to pull any/all data out (modulo rate limiting) manually and then do whatever you like with it.

Incidentally, if you write a tool that lets me move a project from one account to another, I'll pay good money for that!

Simon Woodside
  • 7,175
  • 5
  • 50
  • 66
  • 3 years ago it was not possible to do it, otherwise the question wouldn't be posted here (it was last resort). As I've explained in the comment to the question itself, I accepted your answer as it is the most convenient and 'how it should be done' way, as of today. Unfortunately, shifting projects from one account to another was not the goal, can't help there :) – Oliver Maksimovic Apr 21 '13 at 22:37
2

Both Matt and Peter already proposed using wget --mirror which I think it is the easiest solution out there. However, I was unable to properly copy the cookies from Google Chrome.

Instead I went on a slightly different direction and used the Chrome cookie.txt export extension to copy all cookies as plain text to a cookies.txt file.

My wget command then looked like this:

wget --mirror -e robots=no --reject logout 'http://yourdomain.basecamphq.com' --load-cookies cookies.txt

Additional note for Mac users: wget can be easily installed with homebrew:

brew install wget 
Eneko Alonso
  • 18,884
  • 9
  • 62
  • 84
1

Use this tool for Windows.

In trial mode, this tool will allow three projects to be downloaded from base, will list all the projects on your base account after you login using your basecamp credentials.

Msonic
  • 1,456
  • 15
  • 25
senthilK
  • 46
  • 1
  • According to their website the product (Parachute) is discontinued and cannot be downloaded anymore. – Julian Feb 25 '13 at 20:05
1

basecamp offers you to export your projects in XML, HTML - and there is also a way to get it in PDF. this information could be found in the help/faq section of basecamp: http://basecamphq.com/help/general#exporting_data

more about the PDF export: http://37signals.blogs.com/products/2008/02/export-a-baseca.html

z3cko
  • 3,054
  • 8
  • 40
  • 59
  • I have edited the question. I mean: how to get the files that you have uploaded to your project(s) at Basecamp. They are not provided via API, or I am not aware of that it can be done. – Oliver Maksimovic Jan 18 '10 at 14:43
  • fyi, the PDF export method linked to requires a ColdFusion server (I didn't realize people still use CFM but, myeup) – cyphunk Feb 07 '12 at 13:24
0
  1. Import you Basecamp Classic project to the new Basecamp
  2. Export Data from new Basecamp
  3. Wait
  4. Get email that it's done and download the zip file
Andy Brudtkuhl
  • 3,652
  • 3
  • 27
  • 31
0

You can set up an integration between Basecamp and Dropbox to automatically transfer all your Basecamp attachments into a dedicated Dropbox folder:

http://blog.cloudwork.com/your-automatic-basecamp-dropbox-backup-step-by-step/

The integration is done by CloudWork, which has a free plan so if you don't think you'll be backing up more than 100 attachments a month, it can do it for free. Above that, there is a pricing plan.

0

If you have php installed on your machine, save this code to basecampfilevac.php:

<?
// make sure the folder of the script is writeable (0777)
ini_set('memory_limit', '-1');//keeps the script from timing out

function BasecampCall($endPoint, $usePrefix = true) {

    // From: http://prattski.com/2008/10/22/basecamp-api-examples-using-php-and-curl-get/
    $session = curl_init();

    $basecampId     = '[Your Basecamp Account Id Here]';  //this should be a number like 9999999, You can find it in the URL when you log into Basecamp.
    $username       = '[Your Basecamp Username Here]';
    $password       = '[Your Basecamp Password Here]';
    $emailaddress   = '[Your Basecamp Email Address Here]';

    $basecampUrl     = 'https://basecamp.com/' . $basecampId . '/api/v1/';

    curl_setopt($session, CURLOPT_URL, ($usePrefix == true ? $basecampUrl : "") . $endPoint);
    curl_setopt($session, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
    curl_setopt($session, CURLOPT_HTTPGET, 1);
    curl_setopt($session, CURLOPT_HEADER, false);
    curl_setopt($session, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
    curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($session, CURLOPT_USERAGENT, "MyApp (".$emailaddress.")");

    curl_setopt($session,CURLOPT_USERPWD, $username . ":" . $password);

    if(ereg("^(https)",$request)) curl_setopt($session,CURLOPT_SSL_VERIFYPEER,false);

    $response = curl_exec($session);
    curl_close($session);

    if($usePrefix){
        $r = json_decode($response);
    } else {
        $r = $response;
    }

    return $r;
}

$projects = BasecampCall('projects.json');

// For each project take name and id
foreach($projects as $proj) {

    $pr = array(
        "id"    => (string)$proj->id,
        "name"  => (string)$proj->name
    );

    // Retrieve the attachments
    echo "\nSaving attachments for project: " . $pr['name'] . "...\n";

    @mkdir($pr['name']);

    $filesArray = array();

    $n = 1;
    do {

        $attachments = BasecampCall("projects/" . $proj->id . "/attachments.json?page=" . $n);

        if(count($attachments) > 0) {

            foreach($attachments as $attachment) {

                $file = pathinfo($attachment->name);

                @file_put_contents($pr['name'] . "/" . $file['filename'] . (in_array($file['filename'], $filesArray) ? "-" . rand() : "") . "." . $file['extension'], BasecampCall($attachment->{'url'}, false));

                $filesArray[] = $file['filename'];

                echo "Saving file " . $attachment->name . "...\n";
            }
        }

        $n++;

    } while(count($attachments) == 50);
}
?>

then update the following lines with the correct information:

$basecampId     = '[Your Basecamp Account Id Here]';  //this should be a number like 9999999, You can find it in the URL when you log into Basecamp.
$username       = '[Your Basecamp Username Here]';
$password       = '[Your Basecamp Password Here]';
$emailaddress   = '[Your Basecamp Email Address Here]';

then save and execute this command: php basecampfilevac.php

This is a modified script originally from Rettger Galactic

Quentin
  • 3,971
  • 2
  • 26
  • 29
0

My solution to download the Basecamp export zip-file in bash on the server was quit easy:

  1. Follow the instructions at https://3.basecamp-help.com/article/150-export-your-basecamp-data to start the export.

  2. Wait for Basecamp email with link to the export page.

  3. Open the link to the export download page while having your Browser dev tools open (I'm using Firefox).

  4. Check any GET request in the dev tools and copy that request as cURL command

  5. Paste the cURL command in the shell and change the URL to the download link from the 'Download my export' button

  6. Add -L flag (follow redirects) as well as --output <your_file.zip> to the cURL command.

  7. Execute cURL command and downlad the file ;)

Lenny
  • 143
  • 7