2

So I'm trying to make use of the Basecamp API. The new one located here: https://github.com/basecamp/bcx-api

So I see a similar question that was asked here on SO:

New basecamp api tells me there's no basecamp account at this address

I tried to follow the example, including reading the comments, but it's not working for me. In particular, this comment on the accepted answer:

This is basecamp account id, as you can see this unique id in url after login in basecamp account

Normally when I login to basecamp, I login here:

https : // myclientname dot basecamphq dot com/login.

When I login, it redirects me to

https : // myclientname dot basecamphq.com/clients.

When I am logged into the web interface from there, I can go to a "My Info" link at the top right and there is a "Token for feed readers or the Basecamp API" listed.

But.. I don't have a client id in the url? I tried all kinds of combinations, and nothing worked. Here are some examples of what I tried (using correct values):

curl -u myuser:mypass -H 'User-Agent: MyApp (my@email.com)' https://myclientname.basecamphq.com/api/v1/projects.json`

curl -u myuser:mypass -H 'User-Agent: MyApp (my@email.com)' https://basecamp.com/myclientname/api/v1/projects.json

curl -u myuser:mypass -H 'User-Agent: MyApp (my@email.com)' https://basecamp.com/mytokenhere/api/v1/projects.json


curl -u myuser:mypass -H 'User-Agent: MyApp (my@email.com)' https://myclientname.basecamphq.com/mytokenhere/api/v1/projects.json

curl -u myuser:mypass -H 'User-Agent: MyApp (my@email.com)' https://myclientname.basecamphq.com/myclientname/api/v1/projects.json

curl -u myuser:mypass -H 'User-Agent: MyApp (my@email.com)' https://basecamphq.com/myclientname/api/v1/projects.json

These things are just giving me regular html responses saying stuff like "no basecamp account at this address" or "Oops, that isn't right. You may have typed the URL incorrectly[..]" or sometimes curl returns "curl: (51) SSL peer certificate or SSH remote key was not OK" (like in the last attempt shown)

Soo.. what am I doing wrong here?

edit

I did notice when I log into the basecamphq.com web interface, there are some meta tags at the top of the page (from view-source)

That look like this:

<meta name='current-user' content=1234567>
<meta name='current-identity' content=12345>
<meta name='current-account' content=123456>

I also tried stuff with the current-identity and current-account but those didn't work either, just kept giving me the same messages. e.g.

curl -u myuser:mypass -H 'User-Agent: MyApp (my@email.com)' https://myclientname.basecamphq.com/123456/api/v1/projects.json

curl -u myuser:mypass -H 'User-Agent: MyApp (my@email.com)' https://basecamp.com/123456/api/v1/projects.json
Community
  • 1
  • 1
slinkhi
  • 947
  • 4
  • 16
  • 32

1 Answers1

4

If your url looks like https://mycompany.basecamphq.com/, then you should use the Basecamp Classic API - you'll find the docs here.

Using the API at https://github.com/basecamp/bcx-api is for accounts using the newer version of Basecamp we introduced on March 6th, 2012. Your url would look like https://basecamp.com/1234567 :)

Jim Mackenzie
  • 241
  • 1
  • 2
  • Good to know, and cool to see that Base Camp dev/support monitors SO for stuff like this. – Matthew Poer Mar 08 '14 at 13:32
  • @MatthewPoer well their github page said this is where to look for support! Anyways.. well, this explains why i've had very little luck using `bcx-api` beyond listing projects.. i've been banging my head all night on that..it seems that some of the `bcx-api` commands work, but do not give expected results, and some don't work at all. I'll take a look at the classic API docs, thanks! – slinkhi Mar 08 '14 at 17:22
  • @JimMackenzie and maybe this isn't the right venue for asking, but how would i go about getting on basecamp.com instead of mycompany.basecamphq.com, so that I can take advantage of the newer api? i'm just a peon in my company so i have no idea if it's because they subscribed to some free/cheap version or if it's legacy and they need to upgrade or what.. – slinkhi Mar 08 '14 at 17:28
  • actually maybe i shouldn't be so quick to want to move to the new api.. while i like that it's rest/json based (I'm not diggin' the xml-based syntax for the classic api so far.. but i've been having lots of success using it nonetheless)... either the new api is lacking in documentation or else doesn't (yet) support some stuff.. for example, i'm currently trying to dev a simple interface to only show todo list items w/ a certain content prefix, to make my time-entry efforts easier. I cannot see anywhere in the new api doc how to actually create a new time entry though. – slinkhi Mar 08 '14 at 22:19
  • p.s. - i'm not necessarily asking how to do it or feature request or w/e, seeing as how atm i *am* on the classic api (and i did figure out the classic api syntax just fine).. just sayin'... – slinkhi Mar 08 '14 at 22:21