Bugrocket API Overview

This site describes the Bugrocket API v1, which is currently read-only. If you experience any issues please contact support. See the changelog for changes and updates. Lastly, news about Bugrocket in general (including the API) is best followed via twitter.

Authentication

Authentication is done with http basic auth. You'll find the username and password in your account on the admin page. Simply provide it when making each request.

$ curl -u "username:password" https://account.bugrocket.com/api/v1/path

Schema

  • All access is over HTTPS w/ HTTP Basic Authentication.
  • Accessed through your account's subdomain.
  • Responds with JSON (or JSONP).
  • Responses will include null values rather than omitting fields.

For example:

$ curl -iu "username:password" https://account.bugrocket.com/api/v1/test

Response

HTTP/1.1 200 OK
Content-Type:
application/json; charset=utf-8
Content-Length:
123
{
  "ok": true,
  "version": 1
}

Rate Limiting

By default each account is limited to making 500 requests to the API in any 1 hour period. You can see in the response headers the details of your current usage:

X-RateLimit-Limit:
500
X-RateLimit-Remaining:
499
X-RateLimit-Wait:
0
...response JSON...

Wait is in seconds. Remaining and Limit are in # of requests.

If you require an increased usage quota for an application or use-case, please don't hesitate to contact support.

JSONP

Every action supports a callback parameter which will be the name of a function wrapping the response. You normally use this to make cross-domain requests to the API (such as for a embed-type widget). Here's an example:

$ curl -iu "username:password" https://account.bugrocket.com/api/v1/test?callback=cb

The usual JSON response is the first parameter to the function you named, the second parameter is some relevant HTTP header information:

Content-Type:
application/javascript
cb(
  ...response JSON...,
  {
    "X-RateLimit-Limit": 500,
    "X-RateLimit-Remaining": 499,
    "X-RateLimit-Wait": 0
  }
);

If you specify the parameter (eg. ?callback) but don't provide a value, the function will simply be named jsonp.

You might write a function that handles this like so:

function callbackName( data, headers ) {
  console.log( "DATA:", data );
  console.log( "Requests left:", headers['X-RateLimit-Remaining'] );
}

Errors

The v1 API is read-only, so the error set is simple:

Unauthorized

If your HTTP basic authentication credentials are incorrect you'll get a response like this:

HTTP/1.1 401 Unauthorized
{
  "error": "Access denied."
}
Rate Limited

If you exceed your rate limit, you will get a response like the following:

HTTP/1.1 400 Bad Request
X-RateLimit-Limit:
500
X-RateLimit-Remaining:
0
X-RateLimit-Wait:
1
{
  "error": "Throttled!"
}

Wait is in seconds, the other two are just request counts. See Rate Limiting for details.

Server Error

If Bugrocket is experiencing some kind of problem, you'll get a response like:

HTTP/1.1 500 Internal Server Error
{
  "error": "Server error!"
}
Not Found

If the URL or resource you're asking for doesn't exist, you'll get a not found error like so:

HTTP/1.1 404 Not Found
{
  "error": "Not found!"
}