I’m a keen Basecamp user, and recently wanted to start building some custom functionality based around the API. Unfortunately, there wasn’t a C# wrapper out there, allowing easy access to the API from within .NET, so I’ve created a simple version to do this.
Download it here: SimpleBasecampApi.zip (17 April 2006)
The solution contains two projects. A class library project, consisting of one class, BasecampApi.cs, which has only one method, SendRequest(string command, string request). The command text is always prefixed with a forward slash, eg. /project/list. The request text is an XML string which is posted with the request, as required by the Basecamp API documentation.
As this was built relatively quickly, there’s no data validation, and very little error checking, so if you use this in production code, these are things you should consider implementing. However, I am planning to improve on this, so you might want to check back once in a while to see if there have been any updates.
The second project is a sample winforms applications, which allows you to test the API. It can be used to send requests, and view the XML data sent back. To avoid the hassle of entering your url, username and password each time, simply modify the app.config file accordingly.
Although this simple API wrapper works relatively well, it still requires manual creation and manipulation of XML data. I’ve started working on a second, more advanced version, which wraps objects around the XML data, making it much more intuitive to use. However, there is significant work required in getting this to work properly, and I don’t know if there is enough demand for it to justify the work involved.
I’ll post a copy up here on my blog when I’ve done a bit more work on it, but in the meantime, if anyone is interested, feel free to get in touch and I’ll send you a copy of what I’ve done so far.
Update – 02 May 2006: There’s a really nice PHP Basecamp API wrapper at QuirkeyBlog. Haven’t tested it out yet, but reading the documentation, it’s usage is similar how I imagined the improved C# version wrapper working. Sadly, there wasn’t much (any) feedback on the this post despite numerous downloads, so the job of improving it has taken a back seat, as there appears to be very little demand.
Update – 10 December 2006: It’s good to see someone take this foundation and extend it. Someone has written a much more comprehensive .NET wrapper around the Basecamp API, with proper objects (rather than having to manually craft and parse XML data). It’s only compatible with .NET 2.0 though, but it seems like a lot of people have started using this for new development work anyway. This is definitely worth checking out.
[tags]basecamp, api, wrapper, c#, .net, programming, project management[/tags]