API Access
Teambox has an open API you can use to connect to your applications or services.
We’re serving vanilla XML, following RESTful conventions. At this moment, we have a read-only API.
Introduction
Every part of Teambox can be accessed by the API with simple requests.
Usual actions include listing objects, adding a new one, editing, showing one and destroying a record (index, new, edit, show, delete).
Try this simple request from your command line to see how the API works:
curl http://teambox.com/projects.xml -u username:password
Status Codes
Following convention, the following status codes will be returned:
- Success: 200
- Not Found: 404
- Not Acceptable (invalid format): 406
- Conflict (item already exists): 409
- Unprocessable Entry: 422
- Server Error (hopefully not!): 500
Request headers
Please specify the following headers for your request:
Content-Type: application/xml Accept: application/xml
Quick example
With this simple command, you can get recent activities from Teambox:
curl -u YOUR_USERNAME:YOUR_PASSWORD http://teambox.com/activities.xml
Try this code snippet from your terminal to post a comment to your projects:
curl -X POST -H 'Accept: application/xml' -H 'Content-Type: application/xml' -u YOUR_USERNAME:YOUR_PASSWORD -d '<?xml version="1.0" encoding="UTF-8"?><comment><body>Posting using the API!</body></comment>' http://teambox.com/projects/YOUR_PROJECT/comments
Routes for the API
The following elements are available through the API: Projects, Activities, Users, Comments, Files.
Projects
/projects.xml gives you a listing of all the projects you're in.
/projects/name.xml gives you a listing of the project with permalink name.
Users
/users/username.xml will give you the profile information for a user. Returns full name, contact details and avatar.
Activities for all projects
This will retrieve the latest activities from your activity feed, as in the web version. Activities can be of different types: Creating a comment, adding users to a project, etc.
/activities.xml will return the latest activities for all projects.
/activities/:id/show_new.xml will return activities after the activity whose id is :id for all projects.
/activities/:id/show_more.xml will return activities that happened before activity whose id is :id for all projects.
Activities for a project
/projects/:project_id/activities.xml will return the latest activities for the project with numerical id :project_id
/projects/:project_id/activities/:id/show_new.xml will return activities after the activity whose id is :id for the project with numerical id :project_id
/projects/:project_id/activities/:id/show_more.xml will return activities that happened before activity whose id is :id for the project with numerical id :project_id
Files
Uploads will also be returned as part of the XML for a Comment.
/projects/:project/uploads.xml will return all the files in the project.